If you already have an HQ and then authorize on another tool cupboard that has an HQ you will lose your HQ.
However, this behavior is unwanted as a raider. this is because you will lose your HQ if you authorize to the opposing team's tool cupboard.
If this happens as a raider then it's close to impossible to leave the unintentionally joined HQ.
Possible fix. prevent a player that has an HQ from authorizing on a tool cupboard with an HQ. a message to the play could be printed out telling them to leave their current HQ first. The player would have to run a command to leave their current HQ first to join their friend's HQ. add a command for the player that is not a leader to leave HQ. possible command /hq.traitor this would at least give them the ability to leave an HQ. we could also mark them on the map for a set of time lol.
lastly, there is a temp fix by adding the Cupboard Auto Lock plugin. this is not granted because the player can still remove the lock, but should help mitigate the current problem.