I intentionally try to write myself into a corner.
Real life doesn’t have escape clauses, doors hidden behind solid walls, or handy-dandy ejection seats. Real people find themselves irreversibly stuck in situations all the time. No easy-outs only cleverly hidden. No do-overs given. Reality is made of corners you can not escape, but must only survive.
So, I intentionally write my characters and myself into such places. It’s a nasty but sure-fired way to test the grit of a protagonist.
And as for the grit of the author?
Oh, yeah. You want grit.
Grit is good.