It requires plenty of speculation but given that Mary's abilities tend to be quite hyped by the game, some can even assume that she's one of the few who can do what she does, by that i mean time rewinds in her own garden.
The ability really isnt being given its credit but if Mary REALLY wanted grimm to never escape she definitely could've, he would've been stuck in an eternal loop no matter how much power he gained and only really escaped because of an accident that couldnt be predicted
If you want to speculate even more Grimm who possibly didnt lose his power after the g ending still might have struggled against GG, it's unlikely he simply won on the first try.
Obviously though, the arguments for this are weak, TCO is still a literal ancient old one and though not particularly mentioned by mabel as the strongest (those are the elemental ones, excluding her of course), would still be a top tier, given that she keeps everyone in check and how deeply abnormal it is compared to the rest