What are the odds?
I took a blue gym that was only housing a single Magmar, after the third battle I moved to place a mon in said gym and received an error while choosing said mon. When I reentered the gym to try again a raid for a Quilava had initiated and the gym remained neutral.
Answers
This has happened to me so many times recently, even at around 5-6 a.m. Why the h&ll does Niantic think it's a good idea to remove the egg icon and 1 hour of notice before the raid boss egg hatches? Even a Magikarp boss now has a 2-hour time frame to defeat! Leave this to Legendaries and 4* bosses only. Normal raid bosses don't need that long time waiting in rage. -_-
I was hoping you were going to say you beat the Magmar defender, then a Magmar raid popped up.
I have had similar happen to me, though. I reached a gym controlled by my team, opened it up, clicked to add a defender, scrolled around a few seconds to choose one, then got flipped off by a Lugia that was suddenly raiding it. Only ever managed to get 12 coins that day too.