But, you aren’t stuck with the decision to rent for 40 years. You could be stuck with the decision to buy, however.
If you rent and prices come down in 5 years, then you buy, using your long-term analysis argument. You have flexibility. If life forces you out of the area, you can simply go.
If you buy and prices come down in 5 years, you have spent the last 5 years paying extra to lose money, and you are stuck with the house, possibly upside down. If life forces you out of the area, you have to sell, incurring the 5% transaction cost of doing so, or rent the place out, taking a monthly loss.