("But you could have invested that money instead and the market's gone crazy over that same time span, so maybe you actually lost money, opportunity-cost wise!" sure, but not really, since rent exceeds TCO for houses in my area so I'd have just bled money to that in exchange for no equity whatsoever and probably living somewhere worse)
For another data point, the Manhattan apartment which I'm renting was recently sold. The previous landlord had purchased it in 2016 for $200k higher than the sale price now, over five years later.
I'm renting because I know I'll be moving again within the year. If I had bought a place in NYC when I moved here, I'd have lost a lot more money than I've paid in rent.
Your outcome is pretty close to a best case scenario. And I'm happy for you that things went so swimmingly.
People stop thinking about opportunity cost when it comes to housing for some reason because they just can't stop thinking of paying rent as "throwing away money," without understanding that you're always throwing away money.
To take a simple example, let's say that you have $500k in cash.
Scenario 1: you pay $50k per year in rent from salary, park that $500k in a $2M investment property that returns $85k in rental returns. In this scenario, your returns are property appreciation and rental income. Your costs are mortgage, property tax, home insurance, home repair, and the rent you pay.
Scenario 2: you pay $0 per year in rent from salary, park that $500k in a $2M property that you live in that returns $0 in rental returns (because you live there). In this scenario, your returns are property appreciation. Your costs are mortgage, property tax, home insurance, home repair.
It's entirely possible, and common, for these scenarios to work out to be exactly the same. If you prioritize the purchase of properties that yield very high rents compared to the property value, it's very common for the numbers to work out in favor of owning investment property. And that can include "throwing away" money on rent.
TL;DR: you're never not renting. Even if you pay $0 in rent, the price you pay is the opportunity cost of not renting your house, and not maximizing returns on the money you've parked in it.
The problem with buying is that it’s a single large transaction that you can’t spread over time. Over time ownership turns a profit, but if the time span is less than seven years, you may end up buying at the peak and having to sell near a bottom.