A while ago, there a bug about
duplicate companions after they left and rejoined. As it turns out, the same thing happens to necromancers whenever they animate a corpse that was in their party when it died. Another problem is that this increases your companions count despite not actually increasing the number of companions you have. This means that ambushes quickly get to be very large, which will probably mean the you need to reanimate your corpses more. This can eventually lead to blatantly impossible ambush sizes, as you'll encounter 3000 goblins from a civilization of 1500, and eventually encounter an ambush of 6000 kobolds in world with 5000 total population. These battle predicatably cause massive amounts of lag, and it takes about 3 seconds to complete one move on my system.
As for the bug itself, I believe its caused by the game adding a new pointer to the companions list whenever you attain a new companion, as in DF2010 it was safe to assume that any companions in your party would be unable to leave without be removed from the list. Additionally, there was no way to re-add companions who were already in your party. However, because dead companions aren't removed, necromancy lets you regain companions in your party, resulting in duplicate entries. A quick fix for this would be to add a check when gaining a new companion to see if they're already in you party, and not add them to the companions list if they are.
Brief version: If you play as a necromancer, be careful about reanimating a corpse that was in your party, and be sure to attack one of your corpses occasionally to keep your bugged large army from generating lag-inducing ambushes.