Building on top of the mentioned issue, here is a working example with a @ManyToOne relationship and Hibernate 6.1.7.Final:
HibernateManyToOneIssue.zip
Changing the version to any 6.2.x.Final version will trigger the warning