Fixed in master (5.4) via https://github.com/hibernate/hibernate-orm/pull/3093
Fixed for 6.0 via https://github.com/gavinking/hibernate-orm/commit/58eee06e4834d52184bf5c2e319c7b1a6ee5290c