I also got this error, and as well as another whenever a wild Aron used Dragon Rage, and when a trainer's Staravia used Double Team in the gym.
It's making it hard to continue when I can't take out the 1st or 4th trainer in a challenge and I have to restart, all because of this problem.