Firing all middle management doesn't help: humans are self-interested. What a CEO needs to do is align incentives for middle management with the interests of the firm, so that self-interested middle managers aren't microoptimizing their domains on criteria that don't serve the interests of the company.
That's a good buzzphrase, but I've never seen anyone do it in earnest. I was once on a consulting project to help a "Director" pick appropriate KPIs as part of a company-wide effort to improve departmental performance measurement. They rejected my suggestions to measure their effect on profit. My manager, to rescue the project, told me to ask what they wanted to be measured on, write it down, and hand it back as the report. The Director loved that idea and rattled off a list of metrics that could be easily sandbagged and had no clear relationship with company profit. ... And yes, that company is very large and well-respected.
My experience suggests otherwise. Big organizations are bureaucracies carved up into little fiefdoms, each little lord trying to maximize something different. The boss of the receipt scanners wants to increase headcount, not reduce costs. As a management consultant, I encountered that situation time and again -- an executive choosing an outcome worse for the company, knowing it'd be better for him or herself, or simply out of pride, laziness, or malice. There's a reason why Dilbert rings true for so many office workers.
A new CEO can try to clean things up, but they can't fire all the middle management simultaneously, so the ship turns very slowly. Going back to the software metaphor, it's not the issue of short-term vs long-term thinking on patch vs refactor, but the problem that the system is live and must be highly available during maintenance.