Joe owns the house outright, and everything he earns after that is available for other use & investment. Heck, he can drop his expenses to near zero (compared to a mortgage) and virtually retire with little more than a part-time job.
Fred may be able to play numbers games and make a marginal profit (I didn’t say one couldn’t make money in this, I’ve just concluded the risks outweigh the benefits), but if things go sour he still owes the lender that money. A lot can happen in 30 years.
Most are like Sally, who buys the $400,000 house with $100,000 down (or $0 down), and has to spend the next 30 years earning $600,000 to pay off the loan.
If you pay cash for a $400,000 home and you sell it five years later for $500,000, you've made a 25% return on your "investment."
If you put down $100,000 on a $400,000 home and you sell it five years later for $500,000, the return on your investment is 100% minus five years of interest payments.