Ok I put this under gym battles because it happened while I was attacking a gym.
I legit have defeated the same pokemon 3 different t times. Like the CP shows 0 after the battle. Continue on. Defeat gym screen. Go back in to knock the remaining few and there it is. Full health. Along with a new pokemon added that wasnt there. Gym in question is yellow and there is nobody around me. I would know because this gym is situated in a traffic divide. You HAVE to be either at the opposite side of the highway waiting on a crosswalk or spoofing.
Either way it was completely infuriating. Like dont get me wrong idgaf what you do with golden razz but you shouldn’t be able to put a pokemon on a gym being attacked. It gives an error code.
I guess I answered my own question.