I believe that some CA Dev said that the limit was 300.

As to your mercenaries appearing at weird places. This is because the game remembers the list of units and orders them as they appear in the text file, giving them a number in a sense. When you put a new unit inbetween during a campaign it still has that list of numbers, but now the numbers no longer correspond with the units. If you put the units in the top of the list all units would go down 2 numbers.

The easiest way to see this happening is by saving a setup for a custom battle. Then add 1 unit at the top of the list and reload the saved setup. You will then notice that the units you had previously selected is now replaced by the next in line.

So if you want to add units during a campaign, then you might try adding them at the very bottom of the list.