In the Z-A Royale, if you are spotted by a trainer, sometimes you get stunned with the message "You and your Pokemon were caught off guard!"
In theory it should be for when a trainer sees you without you seeing them, but in practice it seems wildly inconsistent. Sometimes I'll be attacking them and still get that message if they notice me at the last second, and sometimes trainers that I genuinely missed don't give that message. I've even gotten spotted despite visibly knocking out the trainer's lead Pokemon and causing them to send out their second one.
I am interested in how exactly the game checks for getting "caught off guard" from a technical perspective since the inconsistency is kind of amazing to me.