Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
Ally Switch causes Fly to target ally in metronome battles?
https://replay.pokemonshowdown.com/gen8metronomebattle-1486404726
I haven't been able to reproduce this in non-metronome doubles using the normal versions of Fly and Ally Switch.
I haven't found any explanation for this by searching...