You've seen it. the PCs are up against a foe they can't defeat. Strategic withdrawal is an option, a good option, but they don't take it. They redouble their efforts to win.
As a GM it's not against the GM code to look over the top of your GM screen and say, "You guys think that you're not going to be able to win this fight. Retreat is probably the only way to make it out of here." Some GMs seem to act like it is a crime to do this, but it's not.
Players can be a stubborn lot. We are the heroes after all, so we're supposed to win. Right? Winning does not necessarily mean winning every fight. So again, it's not a sin to retreat. But many players feel it is.
Nothing seems to be working? What if I stab the plot?
Backed into a corner, even when it's only the perception that you have been backed into a corner, some players will flail about and do things that are pretty obviously going to sabotage the plot. There are a lot of reasons for this, too many to cover in a blog post to be sure. So how can you deal with this sort of issue?
Don't try and be clever. It's been said, probably with those exact words, in other articles and books on gaming and videos. When you as a GM are trying to be clever you run the risk of making a story too complex to make sense to the players. They receive weekly slices of your story, and they have other things in their lives that are probably more pressing than who poisoned the King's dog, and why! Keep It Simple Stupid. It can be applied to many things, and story development is one of them. Sure, throw in a twist, but don't make your plot look like an Escher painting.
Be forthcoming with data. My favorite variation of this is "Barf forth apocalyptica" which is from the Apocalypse World game. It's advice to get you to be free with descriptive information. Use all five senses to describe a place. Answer questions as completely as you can based on the situation. If the players are asking questions that means you have them thinking. Don't boil it (whatever it is) down to a skill roll if you can avoid it. Mechanics are there to help resolve conflicts and determine the results of things that might be random or chaotic. the game will be a heck of a lot more satisfying to the players, and you as GM, if the players are engaged. If they need a skill roll, fine, but don't make the fare of the PCs hang on something like the roll of the dice. Especially if you've ever seen my players roll dice.
I try and use the skill roll as a measure of scale. The players are going to get (from me) a basic amount of information, and if I have them roll it's to see how much more they should have. I like to keep the background of my PCs in my mind when they're trying to solve a problem. There might be a nugget of information in there that suggests to me they should know more about the thing they're trying to understand than the other PCs. When they roll I let the results tell me something about how much they know, or how well they understand the thing they're trying to understand.
You stabbed the plot, and now I must punish you!
So you've reached a situation where things got bad and a player, perhaps out of lack of knowledge or desperation, and supreme boredom has broken the plot. For those of you who are movie buffs, this is the moment when one of the party has shot the Invisible Swordsman.
Unless this is a deliberate attempt by the players to ruin the plot, and if it is then you need to seek help from another article, you shouldn't punish the players. If they read the situation in a way that was different than how you read it, you shouldn't let the world crumble because the only way to save it was just pushed off a cliff into the sea. Be flexible.
The most important thing here is to be flexible. If you get so rigid that there is only ever one way to do something to move the story forward, than there is a good chance no one is going to have any fun.