I assume this kind of thing is why every quote we got for dead-simple mini-split heat pump installation last year had an effective person-day labor rate of like $2.5k or more (we didn't end up paying, I mean my god, I'll just fucking do it at those prices, it'll take me twice as long as someone who does it every day, but that's insane). Electricians and HVAC workers with certs in crazy-high demand, I guess.
Quotes for other stuff like hardwood floor installation and finishing—a job I'd personally consider harder and requiring greater skill than installing a mini-split in a totally uncomplicated setting—was extremely cheap by comparison.
So we had our central HVAC burn up, and I bought a mini-split heat pump to replace it, because the HVAC companies around me don't do mini-splits. Apparently they also don't just remove old systems unless they are replacing them. So for 30 minutes of demo work, they charged me $2900 to just remove the old system. I need to install the mini-split myself still, but for now, to get me through the summer and fall, I have a couple window units.
The electrical work I need done is because the previous owner (my grandfather-in-law) built the house and did absolutely NOTHING to code, and inspection found none of this. There are splices in the walls, there is yellow romex being used as power lines to sub panels across the lawn, strung from tree to tree to keep it off the ground. The electrical panel is installed 5-inches from the washing machine... where there is water, and lots of it. There are 4 sub panels strewn throughout the house - it is 1300 square feet. There are random nutted romex wires just poking out of holes in the walls. Basically we need the entire house to be rewired.
Same with plumbing, there isn't a single valve in this house. Everything is plumbed directly from the cold or hot lines. So when the shower sprung a leak, we had to turn the mains water off, rip out the shower to fix it, then re-install it. And that is all over the house, as well.
Don't buy a house built by a family member, even if that family member is a GC that builds houses for a living, because they aren't getting paid to build their own house, and will 1000% cut every corner known to man.
If an "inspector" didn't find issues like that you had a bad inspector. Which many of them are. And they have escape clauses in their contracts disclaiming any liability for things they miss.
That's not to say a good inspector will find every fault either. They don't tear walls open, and they don't have x-ray vision. They only inspect what they can see.
Eh every house has elements of this and everyone learns the hard way. After struggling to install a new bathroom exhaust fan a few years ago in a house that was half built by someone 80 years ago and half completely redone by my late father (who did contracting work early on before he became an engineer), I learned that Carpenters/contractors real skill is the experience they have on the job improvising and adapting to the uniqueness of every project they take on because there is no other way around it. The real world does not have perfect APIs/abstractions and in reality neither do most computing systems so improvisation and solving for the problem is the thought process both in home building and coding.
Its very much like an experienced coder going into established codebases and being able to more quickly make changes and improvements. No codebase is perfect and they all seem to have their own uniqueness just like no house is perfect and all have their own quirks. How good or bad it is can be determined by the experience and foresight of the person doing the work but there will still always be uniqueness and quirks.
Once I finally internalized it, I really appreciated the history of my home and the things people did to solve problems as time went on just like a mature codebase. I would argue as long as the property is generally good, its just a fact of life to have to deal with the rest.