I am both a programmer and a plumber, and I can tell you that plumbing isn't as bug-free as you make it out to be. For example, if you stuff too many potato peels down your garbage disposal too quickly, your sink will back up, requiring you to take apart the drain plumbing to get all the peels out. I know, I've had to do this in multiple houses. That's the equivalent of a page crashing when you put in bad data. If you put food down the disposal at a rate it can handle, it will work fine, and if you put reasonably good data into a given Web page, it usually works.
There is an entire industry devoted to fixing "bugs" in plumbing, from drain cleaners to root-removal services. How many bathroom sinks have drain stoppers that don't quite hold the water in the sink? How many shower drains get clogged? How many old pipes leak due to corrosion?
Yes, programming is a trade, like plumbing and electrical work. And like the other trades, programmers have to often fix issues due to problems that either weren't anticipated during construction. In my view, programmers in general don't create code that is particularly more shoddy than craftsmen of any other trade. With each trade, there is a trade-off between quality and cost.