If your Pidgeot was Mega Evolved, then it is not a glitch. Mega Pidgeot has the ability No Guard, meaning that all moves used by the user and all moves used against the user will hit with 100% accuracy. A Pokémon with No Guard can even be hit while using Dig, Dive, Fly, Phantom Force, or Shadow Force. If the opposing Pokémon has No Guard, the same scenario will occur.
If your Pidgeot was not Mega Evolved and the opponent did not have No Guard, then this is definitely a glitch.