There are some houses that never should have been built. You can’t even level them and build a better house on that lot. Either the lot is too small to build on — by current standards — or the land is not fit to hold a house. I have seen both.
Potentially unsolvable problem, type 1

The first kind of problem is a house that was built on a non-conforming lot. “Non-conforming” is a fancy way of saying, “so out of code it isn’t even funny.” (Well, not really, but I had to say it!) “Non-conforming” really means the lot or house on the lot does not meet the code. If the house is on a grossly non-conforming lot, the house can’t be changed much and still be allowed to be there. If the house is non-conforming, it may require a variance to make any significant change to it, even if the changes would make it closer to code.

Every town has its own zoning. Most have different areas with different rules. Suppose the rules for lot size is 4000 SF minimum with 100 feet of frontage. (Frontage is the lot line that is along a street.) If the lot has 4500 SF, but only 95 feet of frontage, it is non-conforming. In order to add an addition — or even a deck in some places — an owner has to get a variance in order to vary from zoning code. Get it? To apply for a variance, you need a hearing and the approval of your neighbors in most places.
So you see the problem. When you want to modify a nasty little house built behind another house, you may have your hands tied to make either house nicer.  The same is so for a tiny house stuck on a tiny lot in a neighborhood with big houses on big lots. Same is true of a house built too far forward on a lot, too close to the neighbors, or otherwise in violation of the setbacks. (Setbacks are the minimum required distance a house must be from the property line.) These are unsolvable problems, even with a lot of money, if you can’t get a variance to make changes on that out-of-code house.
 Potentially unsolvable problem, type 2
The other unsolvable problem is when the land is not fit for a house, but a was built there.
One house I saw was built on land that was filled over a lake. The back foundation was tipped inward about 5 degrees. A previous owner built a second foundation outside the tipped one. He added deeper footings. It didn’t work. It took years, but the house sunk again. The current owner had just put in three-story-deep metal pillars to support the house. My client declined to buy this house. Why? Because the pillars were only there a year, so my client couldn’t be sure the fix would work. Even though the seller’s engineer thought this would work, there was another engineer who thought the first fix — the new back foundation and deeper footings — would work years before. My client bought on more solid ground.
I saw a similar problem with a house built on peat. Peat is the soft soil that develops in bogs. It is a dumb thing to build a house on it. One of my clients saw a house built on peat. The seller had information about how to front foundation wall was totally rebuilt ten years before. The floors seemed straight, everything inside seemed fine. That was until the inspector found a big, displaced crack in the foundation. The poor house was still sinking. My client beat feet out of there.
Since then, I have seen cracked foundations all over that particular neighborhood.

These are houses that even money can’t fix.