Around 2008, I came into a project for a high profile company that had become a nightmare. The devs used Codesmith codegen to generate all their code and initially it must have worked enough to impress stakeholders, but as time went on, growth happened incredibly fast, dev churn became very rapid. $$$ being burnt fast. The code had become the ultimate slopfest (or rather spaghetti soup). Any minor change took a significant amount of time to verify. Sunk cost fallacy became real.
Ended up replacing the whole thing at 5% of the cost.
This was not the first, neither the last.... it's actually more common than it needs to be. These are *large* projects where tech debt was not considered enough early on, and can cause serious financial disruptions later on.
Man-made or AI, the principle remains the same.