you might be overestimating mid-level developers
Maybe, conveniently shortly after you made that point I had to work with a random developer at a nother company, and technically his rating was senior developer, and the nature of his mess that he had gotten into (without codegen) was credibly not "junior like" at all. It was a mess from superfluous complexity from adopting every buzzword along his career, cloud, microservices, configuration management. Not just once each, but for example three different configuration management solutions that all could do the task were in use for different things. I was asked to consult on why it was flakey despite his best efforts and maybe help him simplify what he demanded of the users. Turned out they already had something purpose built for the task installed, and I showed him the single command that required 90% fewer inputs (it could auto-fetch the information) and worked within a few seconds instead of a few minutes and did it entirely on-premise instead of having to go to the cloud and actually worked reliably.
So yeah, that guy probably would have been no worse off from CodeGen AI making his mess.. It also occurred to me that his resume description of his project probably sounds more impressive on a resume despite it being garbage...