That's the shitty thing: there's enough work that doesn't cross the threshold that requires you to pay for technical debt. Otherwise, a lot more managers would be getting burned by it. There's no electric shock when they hit the wrong button. Even if it isn't a "big boom" moment where you can't deliver some huge new feature because of bad architecture and lose a lot of potential money, the little payments are written off to the younger generation to actually rebuild the thing because they have energy/time to burn.
Experience is no silver bullet, but it generally goes a lot further than non-technical tea-leaf-reading or junior dev shotgun programming.
For front-end work maybe, lower down the stack, five years might not be enough to handle the more important things like the corporate RDBMS. A few grey hairs to oversee the youngsters is quite the norm the closer you get to the real value and money of organisations.
Funny, those companies have the least reliable, performant, and maintainable code.
Oh, and a brokerage that actively prevented password managers from pasting passwords into the login form.
Older techies have wised up.