When buying a house people tell you to make sure the roof is in good condition because that’ll be expensive to replace. What they don’t tell you is that is all the other things that you may need to replace and how expensive they are. Fence, paint, siding, water heater, washer/dryer, AC, heater, kitchen appliances, etc. Some this might show up in the inspection report, but it’s hard to get a good idea of what it’ll cost beforehand. Also your realtor will have an incentive to downplay any problems to get the deal done.
For one, they’ll fight tooth and nail not replace things. When there is absolutely no way that heater can be patched up and run a little longer they’ll replace it with the cheapest heater possible using the cheapest HVAC guy possible.