You're not factoring in transaction costs, maintenance, property taxes, and cost of capital (ie. the downpayment). Transaction costs (eg. relators) are 2.5% on each side, so after buying/selling you're already down 5%. Property taxes and maintenance are estimated to be 1% each, so over 4 years you're down 8%. The cost of capital is hard to quantify, especially if you also factor in appreciation, but housing has historically under-preformed the stock market, so that should theoretically be a non-zero cost there.
Suppose we ignore cost of capital (since that's hard to quantify), let's calculate what that % equates to. According to [1] the price to rent ratios is many cities exceed 30. If we use a price to rent ratio of 30, then a $3000/month rent translates to a house price of $1.08M. Factoring in the % costs from before, that's a cost of $140.4k. That's nearly as big as the $144k loss that you budgeted for, before factoring in drop in home price. The maintenance/property taxes alone is going to eat up more than half of your hypothetical $3000 in rent savings.
[1] https://smartasset.com/mortgage/price-to-rent-ratio-in-us-ci...
>However, if your house appreciates as most do in highly industrialized areas, you basically get paid to live there.
but that's the same force that makes housing unaffordable.