> not really, you still need to factor in the cost of capital (ie. downpayment) and the risk that the housing market might collapse.
I disagree - if you're talking about bubbles collapsing that's true no matter how you store your money, e.g. inflation ruining savings, stock market correction, etc.
You need a place to live anyway and government incentives will reduce your cost of living far below renting anyway.
What is true is that you drastically reduce your liquidity but I already presumed that in the scenario anyway by saying staying a few years (any housing correction historically will be resolved in a few years), if applicable