I just tested this code again Hibernate 6.3 {{main}}branch and it worked perfectly.
Note that I’m using Hibernate on its own with no Spring Repository nonsense.