Hi,
that is an assert, i.e., something that should never happen, no matter how weird is the user's setup.
Usually reaching an assert means that you found a bug OR that you forgot something important (e.g., try using WiFi without a mobility model).
HOWEVER, since you don't say what ns-3 version are you using and the script description is so generic that could be applied to almost any script... we can not help you.
The only suggestion I can give you is: try again with the latest ns-3 (possibly ns-3-dev) and check if there's an open bug describing your same problem.
T.