D&D 2024 tried to correct an "unfun" rule wherein one side could be severely damaged or wiped out without having touched a die. While perhaps realistic, it wasn't fun being on the receiving end. Even so, it does stretch the imagination when, every single time, this occurs if you follow the rules to a literal fault:
Setup #1: 1 mile away, the invisible archmage looks out the window of one of the many houses in town at the mercenaries who ruined his plans and prepares to cast meteor swarm (range 1 mile).
DM: (to the party that is haggling at the market). Something seems amiss. Roll for initiative.
This begs whether a Stealth check should be compared to Perception if the party has its back to the caster, who is invisible and a mile away behind a window of one of thousands of windows. Anyhoo, the party wins initiative, surprised or not. They leap to action, taking cover, casting defensive spells, and summoning monstrous allies. The merchants scatter. They've seen this 6th sense crazy stuff before. The archmage, realizing the party has somehow, some way, sensed his invisible presence is a threat from over a mile away, aborts his attack. The DM announces the battle is over.
Setup #2: the enemy scout is soundly sleeping. The party has been watching him for an hour, making sure he's in deep sleep before their rogue, "Syl the Silent," legendary purloiner of the Gem of Ardun, moves in for the kill. The Stealth check is DC 30, impossible we say. The scout will never see it coming.
DM: (who wouldn't allow an enemy to coup de grace a sleeping character without an initiative roll). Something seems amiss in the guard's dreams. Roll for initiative.
The party has terrible rolls. The guard, despite never hearing the impossibly stealthy thief and in a deep sleep, improbably wakes up at a time they otherwise would have slept through the night. The scout sounds the alarm, and the entire enemy camp is awoken.
The same goes for loaded crossbows pointed straight at an unarmed character, and so on. It can seem sometimes that extreme preparation or impossible-to-detect threats (like a guy a mile away when you're shopping in town) should be treated differently. Otherwise, what's the point?
My ultimate point is that all D&D rules, no matter what edition, aren't meant to be inflexible when application of the rule won't make any sense, and you should do what makes the most sense and fun for your group.