When the whole industry manually punched machine code into punch cards, people were threatened by assemblers taking their jobs, and then later by compilers, and now by inference engines.
The real engineering work that will always be paid for is identifying problems and testing solutions to see what solves the problems.
The substrate in which we use to do that will change, but the job will endure.
Those that just do what they are told however, yeah they are SOL unfortunately.
Creative problem solving is the only skill that will matter anymore.
And how many companies need creative problem solving? Way less and less. The problem is the moat is getting higher. Name any other profession that is kneecapped worse than by the free open source movement and the like. Meaning you can't monetize what you create. Or the usual ways are non-conformant, dictated by the corps and their mindless followers.
Almost anyone learn anything they want now. This all cuts both ways.
If security is a solved problem then anyone that wants to teach themselves enough can move to trying to solve disease, until disease is solved, then we all move on to building enough robots to mass produce enough food to solve world hunger and shelter... and once the needs of everyone on earth are solved at an ever cheaper price until it is free... then I guess we do whatever we want.