Taking some time off to travel when you're young is much more than a beach vacation. You meet people (sometimes you meet your future wife), that can become lifelong friends. You learn what you like and don't like; and that the world is infinitely more complicated and beautiful than what you could imagine through books and watching youtube.
After 40 you've already made many of your major life decisions - career, partner, education, kids etc. There's less room for new experiences to alter that trajectory meaningfully.
One thing I've also realized through being lucky enough to enjoy some "semi-retirement" between work is having a healthy balance makes me appreciate both work and "leisure" more. It gets pretty boring to go to the beach every day, it turns out. I was itching to get back to building something by the end.