Found an answer in the hibernate discussions:
https://discourse.hibernate.org/t/migrating-from-hibernate-5-to-6-results-in-error-that-target-lists-have-at-most-1664-entries/11571/4