TL;DR: having tons of cash is better than having debt.
Having both can often be the ideal situation. It’s also really dependent on what the debt is, how is it being serviced…etc. For some people, not having any debt at all is extremely liberating, and that benefit outweighs any of the benefits of getting marginal returns.
Indeed. I lived with my parents into my 30s, saved up for ~10 years and bought a nice house cash, no mortgage. Was it financially optimal? Probably not, but the peace of mind of being immune to market crashes or interest hikes (we tend to not have 20+ years fixed mortgages here) is just really nice.