Code cannot be owned. A creative expression may be copyrighted. Purely functional expressions may not be copyrighted. The output of a trained AI is insufficiently creative to be copyrighted. Only humans can hold a copyright. Now with all that, there really isn’t anything here to get worked up over.
"Purely functional expressions may not be copyrighted." Is this more than a opinion? Because you can have whole programs as a long functional expression (not that I am a fan of such a coding style, but it exists).
For example, if I asked you to write Java code to print the sum of two integer variables named a and b, followed by a newline, you'd probably write pretty much exactly this:
System.out.println(a + b);
You might vary the spacing around the punctuation, or a few other unimportant details, but there's not much room for creativity there while still accomplishing the desired function. It isn't copyrightable.
And this is a good example of how the word functional means something non-mathematical here: that isn't even a functional expression in the mathematical sense, since there's no return value and the printing is a side effect. It's purely imperative.