Hello there!
I just encountered a bug with hail damage.
In the given situation, my bisharp was defeated by walrein, making me pick a new pokémon to fight with.
The problem I encountered is, that the swampert I used to fight on took damage by hail on the turn it was picked to replace my fainted pokemon.
This shouldn't be the case, as the replacement of a fainted pokémon happends after everything else in the current turn (e.g. leftover heal, all attacks, hail damage).
In the screenshot below you can see...
1. Hail is active
2. My swampert has damage, despite the fact it has just switched in (Glacia didn't use entry hazards in this fight)
I hope you can resolve this issue, should this bug appear in all gamemodes (which I assume), it could have a notable impact on PvP, too.
Regards
Unicorn