There are multiple explanations. Here's a couple things I could think of.
-Pokegen: when you use pokegen, stuff like this tends to happen
-Prankster: The ability prankster gives it's holder's status moves +1 priority. If your opponent had prankster and used a status move and was faster, it would've moved first
-Your opponent ALSO held a custap berry: and was faster, or held a quick claw or a similar item.