It's like that famous quote about advertising. "I know 50% of my advertising money is wasted, the trouble is I don't know which half".
Except with middle management, the ones you most want rid of are basically only doing one thing: whatever convinces their superiors that they're the Good Ones. The ones who fail the metrics, who lack 'visibility'... those are either utterly useless (which does happen!) or too busy doing important stuff to make sure they look like they're doing important stuff.