Who created these mid-level managers?

There seems to currently be a crisis in the IT sector. Mid level managers are finding themselves unemployed due to issues within the industry. Who created these managers, and why are they suddenly apparently worthless?
To begin with, what we all fear is finally happening on a large scale. Careers are being made obsolete due to advancements in technology. Certain roles that once required employees in classrooms to do the training are now being replaced with online platforms which can deliver he same level of training in the virtual world. This especially applies to mid-level managers in the IT sector, who are in experiencing a career crisis at present.
Of course, there is room to move in their positions. These workers could even chose to move back down the ladder and re-join the coders. However, if they have been in the position of mid-manager for a long time then they will have forgotten how to code and so simply become outdated as workers.

Such individuals have joined the companies straight out of University as coders and been pulled out of rank to instead become a manager, overseeing the other graduates. This means that, in India alone, of the hundreds of thousands of coders hired over the past few decades, many have been moved up to become managers. Now, many years down the line, they find that they are not needed as a manager yet no longer hold the right skills to be a coder in this day and age.
Yet this is not the only problem with middle management. Upon inspection, it is clear that many of these middle managers do not have the skill set required to do their job satisfactorily.

These managers were pulled out of their coding roles too soon, before they had mastered the art of their occupation. This has had a domino effect on the company, as they oversee the thousands of newbie coders they provide them with insufficient coaching, delivering to them their own inadequate education. This skill-gap is costing the industry heavily, as the companies becomes unable to effectively provide for the trade.
So, why were these employees moved in to middle management? They were young persons, with a love for coding, eager to expand their skills in the business that they love. Instead, they were forced to move in to positions requiring administrative work, interviews, team management and delegation.

The answer is simple- the companies moved them to these positions to keep them within their company. By moving them up in the order, while at the same time discontinuing their practice as a coder, they reduced the chance of such individuals moving to another company.
This truly is a tragedy, as so many workers are now finding themselves not needed in a position they never wanted to be in. The companies created these managers for their own benefit, and now that they are not of any use to them any more, as swiftly as they created them they are expulsing them. The IT pyramid is crumbling.