If AI understood nuances of various industries, it might be possible. I think that's the harder part. We already have tools that generate code, which is what we'd expect an AI to do. But, it has to get to the point of being able to understand a whole slew of other things outside of programming, such as government regulations that affect how things are programmed, user experiences, how one part of the code affects other parts, how to deal with unexpected things (can you imagine an AI dealing with a situation as to why an ODBC call isn't returning data???) Stuff like that. Until AI understands context, and not just one context, but many contexts all at once, it won't replace programmers.
Maybe we'll see this by the time I retire 20 years from now, but I'm not banking on it.