Do you actually have data to back that up, or just one anecdote from a friend? Median pay for electricians is about $57k/year [1], and that's after 4 years of apprenticeship and passing the exam. That's compared to a median salary of over $100k for software devs [2]. Sure, you can make a lot of money as an electrician, HVAC person, welder, etc. if you own and run your own business, but your average tradesperson is not in that category, just like your average software developer isn't running their own dev shop.
There's a huge difference in where plumbers vs. SWEs live, though. You have to compare the actual purchasing power. SWEs are more likely to be located in HCOL areas and therefore have higher salaries because SWEs need the infrastructure cities provide. Whereas there are plenty of plumbers who live in rural areas.
I have no idea how that comparison would shake out, or if the rise of WFH for tech people would/will change it, though.
[1] https://money.usnews.com/careers/best-jobs/electrician/salar...
[2] https://money.usnews.com/careers/best-jobs/software-develope...