your boss's technical competence is the single strongest predictor of workers' well-being
I am not disputing that that is the best correlated variable, but in my experience it is not the lack of technical competence per se which causes problems with bad bosses but instead the concomitant pathologists exhibited by low-skill bosses to compensate for their own incompetence.
I have a story which illustrates the point: Earlier in my career I worked for a state government. One day I get to work and the lead programmer is having something of a breakdown in front of the project manager and they both happen to be standing in front of the entrance to my cubicle. So all I could do was wait there and listen. Turns out that the lead programmer had been devoting all of her time, and struggling for months, to find any way to digest and print the document files previously used in the old oracle/COBOL/dumb terminal system in our new custom client software running on OS X and which was replacing the dumb terminals. So I stand there and listen to the irate complaints from the lead programmer about how the problem was impossible to solve. At the end of the conversation I ask if she would like me to take a look at it. I was done by about 2:00pm the same day. It was easy. I just asked the DB programmer in the cubicle next to me for a sample of a document file. Looks like gibberish so I figure it's not PostScript and therefore must by PCL. Download and install the free GhostPCL renderer, an offshoot of the GhostScript project. Built and installed it. Wrapped the command-line GhostScript in Cocoa's NSTask. Threw together a GUI in interface builder. Wrote a little glue code in Objective-C to invoke Cocoa native classes for loading and displaying the output of GhostPCL and to invoke my NSTask GhostPCL wrapper. And checked the GhostPCL license, which I think might have been GPL, but since I was running it as a separate process and not modifying the source, or redistributing it outside of or organization, we were not compelled to share our custom OS X client source.
Worked great. Everyone was happy. Except the lead programmer, who was livid and from then on set about trying to make my life hell. She banned the project manager from speaking to me. She excluded me from meetings.
The fundamental problem was that the lead programmer did not know how to code. That is not a criticism of her programming skill, I mean she really did not know how to code. As in, literally, could not have programmed a single line to save her life. (Although I can not think of an actual circumstance where anyone would have to do that.) She did not understand what a pointer is. Did not now how to check code out of the repository. Would not have done any good if she had because she did not know how to build code. (In XCode. You click the build button.) Being technically incompetent, she was completely preoccupied with compensating for her own lack of skill, and it was that, not the lack of skill itself, which caused the problems.