In VGC 2020, after using the move ally switch, I tried to use beat up with Whimsicott, which resulted in an ugly error message and the move failed. Here is the replay, and I'll also copy and paste the error message:
TypeError: Cannot read property 'pokemon' of undefined
at Battle.getPokemon (https://play.pokemonshowdown.com/js/battle.js?3d2e38e6:3033:6)
at Battle.runMajor (https://play.pokemonshowdown.com/js/battle.js?3d2e38e6:3326:16)
But it failed!
TypeError: Cannot read property 'pokemon' of undefined
at Battle.getPokemon (https://play.pokemonshowdown.com/js/battle.js?3d2e38e6:3033:6)
at Battle.runMajor (https://play.pokemonshowdown.com/js/battle.js?3d2e38e6:3326:16)
But it failed!