the thing is - there’s a lot of variables that shift the balance towards renting when looking within a time frame, even from a financial perspective.
how long you can stay in one place and whether that fits your needs both today and in a few decades
% of down payment and missed earnings if this money went towards another investment
interest rates
property taxes
HOA fees, if any
likely higher insurance rates over renting
maintenance costs
In the end of the day, since many variables have a large uncertainty, that’s a bit of a gamble. Home ownership tends to win over time, but the longer one looks into the future, the higher this uncertainty also is.