I don't know anything about the back end of showdown, but my guess is that since Metronome targets it's own slot, and Ally switch placed your Gardevoir in that slot, Showdown's code thought you used Bounce on that slot.
Usually you can't use bounce on yourself, and my bet would be that Showdown...