You shouldn’t do electrical work on someone else’s house. If it burns down and electrical is the cause as an unlicensed uninsured electrician you are going to regret that $20 you made.
Coding a web page for a neighbour is different since there are often no ramifications in the physical world if it doesn’t load or look exactly as desired
It’s not a realistic hourly rate given the overheads tradespeople have for things like insurance. Where I live a plumber is $135 for the first half hour and then $135 for every hour after that. Canadian dollars. When the phone rings off the hook at that rate who is going to bother with a $20 job.
For a 10-minute job, $20 is equivalent to $120/hr. If you feel that's too small then pretend they said $40 instead, making it $240/hr. But you're setting up strawmen here. Not every single handyman job needs >$100 insurance for a 10-minute job, and nobody is claiming this is good for plumbing or electrical jobs in particular.
Coding a web page for a neighbour is different since there are often no ramifications in the physical world if it doesn’t load or look exactly as desired