
Hire a better Software Architect
If the ML generated code is inside large human designed and planned functions, methods, objects, etc that is a manageable problem.
I suspect if you let the autogen spew out the top level backbone of your project, then hack away at it, and send it back into the code mutilator, you are right. Fun will ensue after-hours as programming moves into the cots in the back of the QA lab and starts ordering pizza with a double helping of "Colombian Basil".