Those bugs (assuming validity) were there in spite of the careful curation. People tend to do what they can to the best of their abilities. Before compilers did much in terms of static checking a lot more errors made it into production than today. Better tools -> better code.
Whether AI written code is going to be better in the longer term remains to be seen. With what I've looked at so far I'm not super optimistic about this.