I think all jobs that are pure mental labor are under threat to a certain extent from AI.
It's not really certain when real AGI is going to start to become real, but it certainly seems possible that it'll be real soon, and if you can pay $20/month to replace a six figure software developer then a lot of people are in trouble yes. Like a lot of other revolutions like this that have happened, not all of it will be "AI replaces engineer"; some of it will be "engineer who can work with the AI and complement it to be produtive will replace engineer who can't."
Of course that's cold comfort once it reaches the point that AI can do it all. If it makes you feel any better, real engineering is much more difficult than a lot of other pure-mental-labor jobs. It'll probably be one of the last to fall, after marketing, accounting, law, business strategy, and a ton of other white-collar jobs. The world will change a lot. Again, I'm not saying this will happen real soon. But it certainly could.
I think we're right up against the cold reality that a lot of the systems that currently run the world don't really care if people are taken care of and have what they need in order to live. A lot of people who aren't blessed with education and the right setup in life have been struggling really badly for quite a long time no matter how hard they work. People like you and me who made it well into adulthood just being able to go to work and that be enough to be okay are, relatively speaking, lucky in the modern world.
I would say you're right to be concerned about this stuff. I think starting to agitate for a better, more just world for all concerned is probably the best thing you can do about it. Trying to hold back the tide of change that's coming doesn't seem real doable without that part changing.