Bad code from AI is just the latest version of mindlessly pasting from Stack Overflow.
Humans literally can not scan all of SO to make a huge copypasta.
It takes much more time, effort, and thought to find various solutions on SO and patch them together into something that works well.