If you really think those layoffs are due to AI, then you haven't worked in corporations long enough. If companies are not hiring, and are firing, then what do we need middle managers for? In fact, if an engineer is really smart and masters the tools, what do you need POs, managers, executives, and even sales for? If you stretch things to the max, those who master the tools are positioned to automate everyone aside from the capitalist, as they are protected legally
You're thinking of this as a game of merit instead of a game of power accumulation that it actually is. Middle managers, like junk DNA, don't have to actually accomplish anything as long as they can propagate themselves.