The law is very clear that non-human generated content cannot hold copyright.
That monkey that took a picture of itself is a famous example.
But yes, the OP is missing some context. If a human was involved, say in editing the code, then that edited code can be subject to copyright. The unedited code likely cannot.
Human written code cannot be stripped of copyright protection regardless of how much AI garbage you shove in.
Still, all of this is meaningless until a few court cases happen.


https://www.reinhartlaw.com/news-insights/only-humans-can-be-authors-of-copyrightable-works
https://www.copyright.gov/comp3/chap300/ch300-copyrightable-authorship.pdf
A human must be involved in the creation. A human can combine non-human created things to make something new, but the human must be involved, and the non-human created elements likely lack protection themselves.