It's a misunderstanding that AI makes SW engineers less valuable, when the code making is cheaper. This assumes there is some fixed amount of code that the society needs to produce. I think the companies will face a different reality - the code they own ("intellectual property") will become less valuable, but the programmers (who are now effectively promoted to kind of product managers) will become more valuable, as they can now do more (and cause more damage, too).
The innovations of the past, such as compilers and open source, which made programmers more productive, didn't make them obsolete.
That being said, it will take companies (and their owners) some time to accept the new reality - programmers have more power now and it's harder to gatekeep what they work on. So the management of these companies will try to twist it, which will ultimately be counterproductive. The programmers should recognize it and look into some form of social organization - be it unions, professional organization or worker cooperatives. (Distinction of labor vs capital is not a natural law, just like the distinction between lords and peasants isn't god-given.)