I had VanDorn and Jackson in the same region, both three stars, Van Dorn currently with the Army HQ. Jackson outranks VanDorn in seniority, so I want to move the Army HQ to Stonewall (duh).
When clicking on the two of them (I have placed them in their own stack), the pop up message says: You will lose 5 NM if Van Dorn is replaced unless he is replaced by a general with a better seniority this turn. So, believing I complied with this message, I made the switch.
Instead, I lost 5 NM for stripping Van Dorn and apparently 5 NM for giving the army to Jackson when Beauregard (who was elsewhere) had a higher seniority, or for some other unknown reason. No warning about this.
The lesson learned is to ignore the frickin' pop up messages which lie like carpetbaggers. It seems if you are going to swap out an HQ it doesn't matter that the new guy receiving the HQ is a higher seniority, in spite of what the pop up sez.

Update: In the notes under messages, I finally got the notice: Bory is upset that you passed him over. -10NM and -226 VPs.
Jackson better win me the war. Not sure I would have made the switch if I had known that, as I get a new HQ in 4 turns anyway.