The best explanation I've seen for why AI is not going to replace software engineers:
I think it goes back to the question of what software engineering really is. An analogy might help explain this better: Let's look at writing. We tend to confuse the most salient activity of something as the thing itself. In the past, writing meant the physical act of putting words onto paper, and people took pride in calligraphy - "beautiful handwriting means you must be smart and intelligent." But with computers, writing no longer refers to that physical act. Instead, it refers to the process of arranging ideas into a readable format.
I think the same applies to coding. People now think of software engineering as the physical act of putting code into VS Code or whatever IDE you use, but that's not what software engineering is. Software engineering is about solving problems. Coding itself is just the physical manifestation of that process. While AI might automate coding, I don't think it will fully automate problem-solving because you still need to know what the problem is, and only you can understand what problems you're facing.