This is absolutely true when/if renting is cheaper then home ownership, however it is not always cheaper to rent. In my area renting is essentially the same or more expensive depending on size of home in this case there is no opportunity cost, this is even more true as property values rise and rents increase.
My home is a great example of this, we purchased back in 2016, and refi-ed @ 2.75% so our monthly mortgage is $1,700, to rent a single family home like ours would cost a person around $2,500 today. So in reality the renter in my area is actually losing the opportunity cost as well when compared with folks who bought a home.
Obviously there are factors and considerations regarding timing for home buyers and we got incredibly lucky in that we were looking for a home when rates were low and before the market really took off. Folks really just need to consider all of the ins-and-outs and make the choice that works for them financially.