Don’t know why I thought of this, maybe from watching so many vids of ancient history and seeing a lot of weird monasteries. Anyway, probably Twilight Zone. A guy seeks refuge in a secluded monastery. Spoiler: they somehow have the devil locked in a room, they tell the visitor please don’t let him out, and he lets him out. The stupidest thing about this is, shouldn’t they be spending all their time encasing him in an immense tomb? Why would his door have an unlockable lock, and not be bolted shut?
I don’t know, Dumbest Episode Ever probably belongs to every episode of “According to Jim” or maybe “King of Queens”
IIRC the Devil was imprisoned by some holy staff that barred the door. The stupid part was telling the reporter Don’t move the staff then leaving him alone.
My personal worst of K of Q was when they were leaving a theater, and expressing disappointment that the Keaton film festival was of Buster, and not Michael. I would have expected more of a nominal comedian.
Dang, where’s that thread on “the willing suspension of disbelief” when you need it?
OTOH, that would have been funny if it had happened on Arrested Development.
“Lost In Space” so saturated the Dumbest Episode Ever pool that even the worst episodes of any other show you can name would only be a middlingly-bad LiS episode. Even “Gilligan’s Island” or “The Beverly Hillbillies” never claimed to be anything other than comedic farces.
I mean yeah, the holy staff was what was keeping him in the room. But then why not build a brick wall in front of the staff-barred door, and then pour concrete in the hallway after that, and then build a nondescript high-rise apartment building on top of that?

But then why not build a brick wall in front of the staff-barred door
Mumble mumble something something free will.
Refusing evil is meaningless unless you have a credible opportunity to be evil. I could easily headcanon that the Devil isn’t restrained if he doesn’t have some opportunity to be freed. It’s an old trope.
The one episode of The Goldbergs that I unfortunately watched.
Oh sure, that’s the thematic reason for why it was how it was - and also to serve as an object lesson about good intentions. Raises interesting questions about a selfless act - in this case helping someone who is, to all appearances, a wronged innocent party - that then has catastrophic results.
Still doesn’t change that the setup was dumb. You can ask those questions and explore those themes without a laughably flimsy premise.
It’s art. Artistic license for thematic rule of cool. Sure, in a sane and rational world of discourse, it’s a dumb setup. But it’s the supernatural, so your petty logic can’t stand in the way of telling a good story. (Or a tired one.)
Still, coming back to the point: it is reasonable and arguably accurate that the situation is dumb. If that breaks suspension of disbelief (because you can’t live with the irrational supernatural run rules of the plot) that is completely reasonable.
Even worse was a Twilight Zone “I Shot an Arrow into the Air,” where a rocket crashed shortly after takeoff and the big twist at the end was that they had crashed onto Earth.
Where else could they have been? There was no mention of being traveling for any length of time. The gravity is the same as Earth, the air is breathable, the sky is blue. Yet no one even considers the possibility.
Doctor Who had an episode in which a worldwide hypersonic fireball let loose a minute before the poison gas everybody has been breathing for hours would reach peak cleanses the Earth’s atmosphere instead of killing every living thing.

“Lost In Space” so saturated the Dumbest Episode Ever pool that even the worst episodes of any other show you can name would only be a middlingly-bad LiS episode.
True, but, c’mon Lumpy, you know what the worst epi was:
MOISTURE!
Jeeze, it’s hard enough to crash an airplane and walk away, and this is a damn rocket! Did they have Nerf planets back then?
The great Sir Terry Pratchett (in his book The Thief of Time)said it best, "Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying 'End-of-the-World Switch. PLEASE DO NOT TOUCH’, the paint wouldn’t even have time to dry. ”
Breaking Bad - The Fly
Easily the strangest and most meaningless of episodes. Breaking Bad isn’t rewatchable in general, it’s dark and emotional turmoil is not fun to rewatch, but I certainly never need to see that episode again, syndicated or otherwise.

That very scenario in bonechilling detail.