[hibernate-issues] [JIRA] (HHH-12637) Add more tests and improve fix for HHH-12592