Time, feature changes, bugs, emergent needs of the system all drive these sorts of changes.
No amount of "clean code" is going to eliminate these problems in the long term.
All AI is doing is speed running your code base into a legacy system (like the one you describe).