I think it is related to https://hibernate.atlassian.net/browse/HHH-11147
I started with version 5.3.10 and cherry picked commits until I got the error and it showed up after i merged commits from that issue.