...then said DM isn't also putting them into situations where they have no chance of success. In such games, the players choose to get themselves into those situations given an informed choice and typically have many ways of dealing with it rather than head on. ...
Right...but from the player POV there is also a bit of a social contract that they will follow the adventure presented by the DM rather than go down rabbit holes. So miscommunications can happen. As DM I think I am presenting a few different choices, one of which is obvious folly while the players end up focusing on on the obvious and not the folly because they are thinking the other side of that contract is the DM won't present challenges that are too hard.
the
I try to use a rule of three for this situation. I'm running Forge of Fury right now (SPOILERS!!!).
My players typically use stealth and subterfuge rather than brute force. But for some reason they chose brute force on their approach to this one...
The road leads directly to the dungeon door. But I also described smoke rising from cracks in the side of the hill, an NPC told them about humanoid creatures that come out of the ground on the other side to snatch prisoners and they are aware of a dragon that hunts the area around the nearby lake. All of those hint at secret entrances. They know orcs use the dungeon as a staging point for raids.
After describing all of this they said they go up to the entrance (which is guarded). Before they got there, I asked them if they search anything first (HINT HINT!). They decided to look around and found tracks of orcs leaving recently mingled with lots of older orc tracks going up and down the road. They said they proceed. So then as they got close I asked them again if they do anything other than just walk up...they decided to use the two familiars they have to scout...they spotted the guards lounging by the door. I also repeated the bit about the smoke coming out of cracks and even told them that it looked more like wood smoke rather than any geothermal activity.
I felt like I was beating them over the head with all the signs that there are back ways in...Then one of them said he attacks the guards and the others said they joined them. I felt like I had given them the option 3 times to not go with the frontal assault that I though might doom them. They chose it anyway. It was on them at this point.
But one thing I did not do that I have seen some DMs do is enforce a "punishment" on them for not following the path I thought they should go. Once they were locked into the frontal assault I readily pointed out things the PCs would notice that maybe the players would not that could be used to their advantage or used against them. Places to take cover from the arrow slits, the fact that the doors were open and could be barred from the inside, when they spotted an ogre I pointed out the squeezing rules. I also had the orcs and their allies act individually on knowledge they would have and their own personal goals. In other words I did not have them all act as one unit with perfect knowledge of what the PCs were doing in order for me to "win" the fight.
I even hedged just a bit and decided that the Orc Eye of Gruumsh was envious of the Ogre and allowed him to be killed by the PCs by staying out of the fight. This leaves room for some post battle RP rather than just more combat encounters...
My point is as I said before and you reinforced: A DM's job is not to impose solutions or outcomes on the PCs. A DM's job is to describe the options the players have and the knowledge the PCs have and maybe signal some of the potential consequences. Then let the chips fall where they may. If the PCs can figure out a reasonable way to get in a long rest before going after the BBEG, then kudos to them.