https://replay.pokemonshowdown.com/gen8metronomebattle-1132412449
On turn 4, my metronome called Fly with my first mon and Ally Switch with my second mon. The following turn, Fly activated, attacking my own Pokemon in the original slot. Presumably this is a bug caused by having the second turn...