There's a few layers of assumption in there. We're not going to unpack all that here.
Best bet to win out against the Ai tech apocalypse? Things that involve personal decisions by people. Ai is shit at hitting weird non-sense contradictory notes from people that don't understand how you do what you do.
Network engineering. Tons to learn, requires great brain power, mental modelling, and decision-making skills.
And FWIW, I don't think most high-level tech jobs are at risk to losing to AI/ML -- at least for decades. Augment and change the job? Sure. Already happening.
realize, software-development ist NOT (!) (only) about writing code.
its about solving problems / adding value for your company / client.
* learn & understand your companys / clients domain
* learn to proper communicate within the team - horizontally
* learn to proper communicate with the non-technical people of your company / the client - vertically
imho. AI can't replace this kind of work - at least for now / as long as AI == GPTs ...
cheersv