Most of the AI's units did not have a Veteran Sergeant.
So for 1 unit to get it 3 times and also having exactly 1 leveled up twice and another just once is really unlikely imo.
So, could it be that actually the code didn't replace the veteran Sergeant with a Lieutenant and later a Captain but instead added those?

