I've also had this happen to me on one occasion. The Celebi escort in the story gets Aura Sphere (line of sight move), and if I use manual team control to make them use it when I'm between an enemy, I'm the one who gets hit. The Gap Prober IQ skill (enabled by default for all Pokes at 0 IQ) is supposed to allow it to attack through teammates, but maybe it doesn't apply for escorts?
Anyways, this hack is super fun. The development time really shows, looking forward to 1.3. I got a lot of shiny legendary recruit grinding to do in the meantime, along with waiting for Entei's challenge letter.