I agree completely, most people overlook the "opportunity cost" of investments. If an investment makes %3 per year but you could invest in something else that makes %4 per year, while you did make profit, you actually lost money, because you missed an opportunity to make an extra revenue equals to %1 of your money (or %33 more profit).
Or more common, knowing how to balance a smaller payout now vs. a larger payout in the future. If you are investing, the smaller payout might be the more valuable option. Of course most people don't invest, which is why future discount isn't widely understood.
The difference is that they can buy homes on margin, whereas no one would lend to them to invest in the market on margin. Return has to account for only putting 5% to 20% down. Not that I think homes are a good investment outside of the few burgeoning cities in the US, compared to index funds, time/labor costs included.
You also see this kind of argument against housing a lot, which also ignores that housing is one of the few highly leveraged investments an individual can/will make, and that even if you don't buy a house you will have to pay for housing, all of which goes to someone else's pocket.
Your summary is missing a critical factor: you probably need somewhere to live. Let's simplify that to the binary choice of rent or buy, so now your decision is: what is the risks and rewards for my "portfolio" after X years renting versus after X years buying.
For your incomplete example, if the summed cost of rentals was $10k higher than cost of owning the home, then they made a profit.