There have been many instances of this occuring. Such as Lance's Dragonite at LV 50 when it evolves at LV 55 in the Elite Four in Hg/Ss. GameFreak did this for one main reason. They wanted to make the game more challenging.
GameFreak does this with every game, they just do it to make the game more difficult.
That's how Gamefreak desighned the game to fight Ghetsis.There's no explination to say that the game is glitched. (HOPE THIS HELPS!) :)