That things rarely go according to plan is part of running an RPG. The players will surprise you, and often this is entirely fine - in fact, it might result in a more memorable experience and a better game.
But sometimes, things go off the rail in a bad way - and you, as a GM, did not see it coming until it was too late, resulting in disaster and a non-fun experience for all concerned.
And contemplating some of my past mistakes, I am curious about your biggest GMing regrets. What went wrong, and what would you have done differently if you had the opportunity for a do-over?
My biggest regret is playing 4E or 5E instead of other systems. We should have played OSE, Call of Cthulhu, Numenera, or anything besides those two.
PF2 is a good alternative to 5e if your players enjoy that style of world / same level of fantasy but want more control over their characters and the combat flow.