I was just battling on Showdown, and the system went weird part way through the battle. I had just switched in Xerneas and used Geomancy. Showdown then proceeded to tell me I could only use Geomancy (even though it was on random matchup with a power herb on it) and I was trapped therefore I couldn't switch. At this time the other player also left the battle.
I have the replay saved and it's here http://replay.pokemonshowdown.com/randombattle-89311460
I have the replay saved and it's here http://replay.pokemonshowdown.com/randombattle-89311460