In your "example", if you're very lucky and both buy and sell at the right time during a housing bubble then relocate to an area not experiencing a bubble, then maybe. (I believe you are severely underestimating the carrying costs of a typical house though, it's not just the big stuff.)
However, that's not even remotely close to the typical case. House prices rising fast enough to cover all those costs is indication of an unsustainable bubble.
https://inflationdata.com/articles/inflation-adjusted-prices...
>We can see that if you had bought a house at the peak in 1980 you would have lost purchasing power if you had sold in 1985 (not to mention transaction costs). And then for a little while around 1990 you would have been slightly ahead, but then through most of the 1990’s you would actually be losing money once again. So you’ve paid off half of your 30 year mortgage, you’ve paid taxes, insurance, maintenance, etc. and your house has not kept up with inflation!
You also have to keep in mind the economy of most towns and some cities is very, very volatile and depends heavily on 1-2 employers or industries. Those go away and there's economic collapse. When there's large economic collapse then buy buy home value.
(It's personal preference but I disagree with the idea of leaving family [besides spouse] any significant amount of money/assets when you die - most of my estate is going to charity upon my death)