People who enjoy programming and long stretches of mental exercise are rare, and have been rare throughout history.
I didn't get into tech by a boot camp or something I was originally in phys/eng but picked up building LAMP websites on the side. Took me like 3-5 years before I actually made money from writing code.
An aside, but I am truly concerned that our path from working to professional class via tech work is closing up behind us.
I think the key is the understanding that programmers are are properly paid for their work, and now we need to make sure teachers, janitors and garbage men and the like get to have good, stable lives. And yes, I think janitors and garbage men should make as much as programmers.
I'd assume painting is stable and bs free.
Struggling to achieve results can still hurt though.
Programming, which purely follows logic, is much less frustrating for people for whom logic is their primary mode of functioning.
It hurts but it's my own pain. I decide how much, the kind, the time...
In it jobs, social interactions cause so much friction, information uncertainty, bad dependencies .. it adds to the raw effort.
That said it also helps avoiding rabbit holes too deep.