Copyright doesn't matter. It's about academic honesty, not whether you have the right to use the work. You can even plagiarize your own work.
Plagiarism and copyright infringement have some overlap but they're distinct. You can be guilty of plagiarism by taking something in the public domain and presenting it as your own work.
It's not settled law yet. Many jurisdictions seem inclined to assign no copyright at all to AI-generated works, like the United States and the European Union.