This is a complex question. Some "Technically Incompetent Managers" (a TIM as you call it) are dead weight, as you suggest, and others definitely not.
I should emphasize that I am a technical person in software. I also manage.
That said, consider other "technical" fields. Do you think that a hospital can only be managed by doctors? Should pharmaceutical companies only be run by organic chemistry or biological scientists? Should the best football players be "promoted" to coach and stop playing? Should the best teachers become administrators or the principal of a school?
Software companies and engineering is not much different, in regards to management. These TIM's have management skills that may be valuable to the business. Certainly the most competent doctor in a hospital should know more about medicine in his/her practice than the CEO of the hospital in which they work. And the CEO should certainly know more about accounting, HR policies, financial contracts, etc. than the most competent doctor.
It is also easy to imagine that technical/scientific people in those companies will see their managers as both competent and incompetent to varying degrees. And sometimes companies need management with less technical focus, and sometimes they require more. And as companies grow, it is harder to have the right mix and/or identify and retain the true "top performers" that are highly skilled in all areas required.
So a "technically incompetent manager" is not explicitly a problem in every instance. In fact, someone's ability to navigate through a technical corporation despite technical competence could almost make their ability to "bullshit" their way up through the ranks even more impressive, in some ways.
That said, this does not invalidate your concern about the situation at your company. Competent leadership should be able to separate the TIM's that do not add value to the company from those that are not technically skilled, but have political, social or other economic value to the company.
However, this may be difficult to recognize in your company - and requires a different question from the one you posted. Your question is predicated on the need for a manager to be technically skilled, which is a fantastic quality in a manager, but not a prerequisite in all instances.
To address the list that describes your a "typical" scenario you should consider that your company sounds like it has a lot of very technically skilled people that have a disregard for, or at a minimum devalue, non-technical ("soft") skills. When a non-technical manager needs support, the technical talent that supports them is likely to be more technically skilled than the manager. In fact, it basically should be that way - management requires non-technical skills. There will be varying degrees of technical skills with managers, and tolerance of those soft skills should be something to understand better and value.
I know technical people generally do not like to hear this. And "soft" skills people oftentimes overvalue their skills or engage in non-productive activities under the guise of developing "relationships" or performing other non-technical business development when they are not actually doing anything of the sort.
If you want to be particularly useful to your company, then understanding this gap better and how to handle both sides of it are probably worthwhile. The political prowess of these TIM's is a very real factor in business. Rejecting it does not help you to understand it value.
Last, I do not want to appear to have ignored your opening statement, that you recognize and value that there are managers having both deep technical and social skills. As a counter example, you are probably aware of some very technically skilled people in your company with few social skills, yet they still are valuable to the company despite their shortcomings. Your questions focuses on the converse - those that are not technically skilled but their social and soft skills make them valuable despite their technical shortcomings. Having both is a rare combination. You are fortunate to have them in your company.
Based on the comments, it is correct that you asked "How to get rid of incompetent managers?"
The rest of your question, however, focuses on technical competence, not managerial competence. So the question and the content are not well aligned.
Assuming that the TIM's are also incompetent managers, then to be rid of them you have several options:
Become less technical and more managerial in an effort to improve the competence of management overall. You cannot "expose" incompetent management if you are not qualified to assess it. Technical skills, no matter how amazing, are not qualified to assessment management skills.
Ask for more communication from management as to the management qualifications of the TIM's. This is respectful in the sense that you are asking for an assessment and explanation. The managers that are both technical and socially skilled should be able to help bridge this gap. However, their answers may not be satisfactory but you should be assured that this is not necessary. The request for the explanation, if taken seriously, will require significant focus on the TIM's and connecting their actions to value within the company. If you have confidence in those managers, then you should have confidence in their assessment of the TIM's.
You should recognize that if you are not superior to these TIM's, then any direct action you take to "get rid of them" is a lot like trying to "push with a rope" - you are on the wrong end of the tool to take direct action. However, you should then work on becoming more skilled with indirect action. This is where these TIM's are highly skilled - so study them, take notes and try to understand how they are gaining power/authority/respect from management despite their technical incompetence. This will put you in a position to help your managers understand your concerns better, and help you rid the company of those that are not compensating for their technical incompetence through non-technical contributions.
Last, if none of these options are appealing or you are not capable (for whatever reason, like time or family restrictions) to accomplish, then you need to rely on time and your confidence in the competent leadership that exists in your company to rid you of the TIM's. If your leadership is really both technically and socially savvy, TIM's without sufficient value will be discovered and replaced. Management is not perfect, but they should be able to vet them out. Otherwise, perhaps your assessment of them is exaggerated.
Ridding yourself of the incompetent is never easy when they are sly enough to avoid being recognized as incompetent by their superiors. And ridding yourself of the competent that you perceive as incompetent is a disservice to yourself, above all.