It has happened to me too a couple of times and it can really ruin a mission, it is very annoying when it happens.
Reading from the ComRef, it appears that a group can have both a leader and a formation leader or formation leaders, and those are not necessarily the same unit. I just wonder what makes these separate automatically. I call it a bug until someone tells me a good reason why it happens automatically without my approval.
I'm not able to do any testing now myself, but it could be worthwhile to experiment with the scripting commands
formLeader,
formationLeader,
formationMembers,
formationPosition and
formationTask. Observe what those commands return and try if you can change the leader of the formation by yourself somehow. Maybe the command
commandFollow is useful in fixing this problem. By reading from the ComRef I would say without testing, that this command can be used to form new formations inside a group. My bet is that for some reason this can happen automatically in ArmA and that causes the problem we have experienced. If you can change the formation leader of different units by yourself with the help of scripting commands, then you could create a script that automatically fixes the problem by detecting when the group leader is not anymore the formation leader of some units in the group, and changes it back to how it should be. This could also create problems, for example if the player tries to assign teams inside the group and our script prevents it from working by messing with the formation leader.
Also scripting commands that might be related (probably not) are
selectLeader,
effectiveCommander,
assignTeam and
unassignTeam.
Notice that I have not tried any of these commands, I am just reading from the ComRef and giving you suggestions where to look if you want to try and make this problem disappear.