I can't speak to all markets, but in my experience in a HCOL city in the U.S., this is not true, at least anymore. Buying a place never broke even with renting an equivalently sized one, even in the long run. Yes, there are lifestyle advantages to homeownership, but at my current place and time, not financial advantages.
I live in a low-mid CoL city, so I guess this is all super YMMV, but even with a 5% down payment, a decent home would run me around $1.5k/mo in mortgage payments (including interest, principal, PMI, and an escrow payment for taxes and insurance), whereas an equivalent rental would run well over $2k/mo, possibly closer to $2.5k/mo.
Sure, I can (and do) rent an apartment for less than a house, but that means rent increases whenever the owner feels like it - my rent has been steadily increasing to the tune of about 5%/yr, and this year it was all the way up to a 7% increase.
I was in a similar boat years ago. The company I rented from wanted to increase my rent 12% year over year. I told them I didn't make 12% more money, spent a lot of time pleading, and talked them down to merely 9%. Rents were all over the place, and there was little I could do about, except move to a new apartment every year.