If Mewtwo & Mew GX flips tails on an attack while being confused, it takes 30 damage but also attacks the opponent.
Just encountered a bug where the enemy switched out their poisoned active pokémon out of active spot with a Switch and the new active pokémon didn't get poisoned.