Yes, this bug is unofficially known as "Drunk Soldiers", because the units run around like they are intoxicated.

We don't actually know if the unit count is per team or over the whole game. We also don't know if 256 is the number, but it seems likely. AI defence positions are different, but THEY TOO HAVE A LIMIT. (keep reading) Soldiers going crazy basically has to be drunk soldiers, going over the AI defence limit just means excess ones are ignored.
Are you using my mission editor? (latest version 0.9 required for these instructions to work properly) If so then I suggest you click Help -> Help on the menu, then go to Appendix -> Game Bugs and also Command Limits. Game bugs explains some of the errors that are relevant to mission making, and the Command Limits page shows the the limits available for some commands (I think AI Defence Positions is 20 per team) You really should read these two pages as I think they will give you a better understand of the bugs and limits you need to know about for scripting.
Hope this helps, let me know if you want more information or have more questions.
Lewin.