I have had incredibly atrocious work done by licensed individuals of all stripes. In one case they took out a mechanics lien on the house when I refused to pay for unfinished and shoddy work and then one of their workers assaulted my wife.
- Horizontal exhaust run from a furnace that was 25x longer than specified by the manufacturer
- Putting registers in very wrong places (like 2 in one room and 0 in another instead of one in each)
- (For Electrical) Rather than using junction boxes, just wire-nut together some Romex in random places in the attic.
Geez, sorry you dealt with that. In my town, this would never pass inspection, which certainly costs something in taxes, permits, and labor cost, but I think it would be difficult to end up saddled with bad work.
All the contractors around here push really hard to do the work without permits. It takes at least twice as long to finish with permits since there needs to be an inspection after each step that will get covered up by something else (and since much work is done unpermitted, many contractors forget to do this and have to redo work).
I always pull permits these days because of stupid stuff contractors have done; the horizontal duct run that was way out of spec was found by an inspector and I had to call 4 HVAC contractors before finding one that would do a quote that included permits...
Fun fact - In some states, contracts with unlicensed contractors are unenforceable.