AI generates code, not meant to be used as is but to be improved upon. It says in the bottom of any text/picture/sound/video machine learning generator that it might contain errors. The person who ran the generator needs, therefore to correct bugs that appear.