This will be fixed by HHH-10476.
I've added at test to https://github.com/hibernate/hibernate-orm/pull/1275 that reproduces this issue:
https://github.com/gbadner/hibernate-core/commit/995bb796422f7679d70a007652124d8a9ce2ba42