Where? No electrician is inspecting every house that goes up for sale in the US. Sure you can ask an electrician to inspect a house electrical… but that doesn’t bar a house sale anywhere I’ve ever seen.
But they do not remove the panel cover to look inside, nor do they open up any receptacle box anywhere to look at any of the wiring inside. So they wouldn't know (nor discover) if the wiring job was done well or done in a shoddy manner.
They won't stop you from selling the house as-is but some buyers will walk, some will demand you get it permitted, most will at least want a real inspection done. Getting as-built work permitted after the fact will cost 2-3x as much in permit costs than it would have if done properly, and it may require you to remove drywall to expose things for inspection, but as long as it meets code you won't have to rip everything out and have it redone by a licensed person. In most places you can do work on your own house, so it's the lack of permit that needs to be remedied.
I just sold a 120 year old house. “I don’t know” is a valid answer to the disclosure requirement but it better be true.
When I've have had some new windows installed a couple of times, the installer tacked on a lead mitigation fee which was fine because they knew there was probably lead paint buried somewhere but I don't actually specifically know about lead paint buried under layers of newer paint and the like and most of the interior has been reworked to a significant degree.
If you personally really care, don't buy an old house. (Also, when I had the latest round of rework after a kitchen fire, my electrician replaced a bunch of remaining knob and tube wiring which probably dated to whenever the house was electrified.)
Speaking of lead ... I was surprised we didn't get any pushback from the floor guys on that. Someone had painted parts of the floors, then laid linoleum in the middle, and my mom had a lot of it covered in carpet that was really in rough shape at this point. I couldn't get a positive test on the paint for lead with an inexpensive test kit but I really would be surprised if there wasn't any. But the guys doing the floor didn't even bring it up. And this is work they specialize in, so they deal with a lot of floors this vintage.
That's sort of the key. If you have your eye on a >100 year old home, love on unless you're OK with a lot of what probably comes with that.
In Texas every homeowner is legally entitled to work on their own electrical system without oversight from an electrician.
The city isn't in the business of busting doors and issuing citations if you replace kitchen cabinets without a permit. They basically act if someone credibly complains, which is mostly if you're doing some exterior additions / changes that annoy a neighbor.
Sure, if the odds are 50/50, or you go to jail, or the fines are $50k or something, then yeah, do it right from the start.
But if there's a 2% chance of getting caught, getting caught costs you 150%, and not getting caught costs you 10%...the choice is pretty obvious here, isn't it?