There are only three foure possible ways for this to happen:
1: No Guard
Pokémon with the ability No Guard can hit Pokémon using moves like Fly, Bounce, and Dig. So if you were fighting a Pokémon with No Guard and they used Toxic/Poison Powder, then that would explain it.
2: Toxic used by a Poison-type.
Something brought up by Aura Warrior, and something that I heard one time a while ago and promptly forgot, was that a Poison-type Pokémon using the move Toxic from XY onwards will never miss, ever. Here's what Bulbapedia says:
Toxic will never miss if used by a Poison-type Pokémon, even during the semi-invulnerable turn of moves such as Fly and Dig.
3: Lock-On / Mind Reader
Pokémon in the semi-invulnerable state of moves like Bounce can be hit mid-move if the target used either Lock-On or Mind Reader in the previous turn, then used Toxic/Poison Powder.
4: Toxic Orb
This is very unlikely but still plausible. If Gyarados was holding a Toxic Orb, and used Bounce the very first turn it was in battle, then the Toxic Orb would activate when Gyarados was in the air.
These are the only scenarios where a Pokémon using Bounce can be poisoned. If it was none of these then I am thoroughly stumped.