This is something OpenXCOM (and I think the classic games too, though I havent played those games vanilla for years) do much better than the modern XCOM games.
What I mean by this, is being able to leave at some point in the mission without losing all your troops and equipment.
I'll give an example. I was playing OpenXCOM Extended with the X-COM Files mod, and it was fairly early in the run so the Aliens shouldnt have really been showing up yet, instead the various other factions should have been the focus at this time in the playthrough.
But I got a mission where allied troops had downed a UFO and needed assistance.
Intrigued, I sent one of my teams and landed to a brilliant firefight between my Allies and the Aliens (of which there were many of both, I was on the hardest difficulty which in OpenXCOM really ramps up the numbers).
The aliens were using laser and plasma weapons which were cutting down the horde that was my Allies with ease.
I lost two guys of my 8-man team in one turn to a particularly vicious Sectoid sniper.
I thought "This isnt working" but wanted to get something out of it, so I had my team advance under a veritable waterfall of stun, flash and smoke grenades and, as luck would have it, I found a Sectoid Commander and a Sectoid Navigator.
I had my team assume the Schoolyard Bully Formation and beat the stuffing out of them. I promptly cuffed them, grabbed their bodies and equipment and hightailed it back to my vehicle and left.
Now, did I objectively win this mission? No. I lost two guys and left without killing all the aliens. But I still got something out of it, and it remains one of my favourite missions ever in an XCOM game because it felt great to play.
If XCOM 3 ever does release, I hope we get something like this rather than "Do-or-Die" missions.
It would also make the game less frustrating if you can cut your losses and leave instead of having to try and struggle through an unwinnable mission.