This is not a bug, but it does make for some odd scenarios.
The first game i ever played, I captured a minor-faction planet very near the Altarian homeworld. As soon as the planet was mine, it insta-flipped to the Altarians. I tried recapturing it, and it insta-flipped again.
It's kinda cool that it creates an emergent system where you can't dive in and grab planets out of the opponent’s back pocket. On the other hand, the AI needs to know about this.