We had a thread go to 500 posts once debating whether or not it was a wise idea to try and kill the king in his own court at lower levels.
The conclusion was that some players like to play characters in the world and some players,want to play as General Zod prancing about the landscape doing as they please with everything adjusted to their level to be capable of being defeated.
Neither playstyle is objectively better.
But my opinion is that when the players do a dangerously stupid thing, there should be consequences.
Of course, if they were honestly that much more powerful than a king's defences were likely to be, then the king was the dumb one.
Meeting deadly adventurers is unpopular Prince work.
That said, I've screwed up and let parties get away with things they shouldn't have, simply because I couldn't think of a reasonable way to stop the party at the time.
I once had a party murderhobo the evil, but well connected villain and then just steal his gold, buy a ship, and nope the fuck out of dodge.
/tg/ later pointed out how I could have handled it and then gave me the perfect weapon to stop my group's evading consequences: J. Jonah Jameson.