I opened PR with my proposed fix, but I am not a specialist with a bytecode so I am not 100% sure if this is the correct fix, but this makes the code work.
https://github.com/hibernate/hibernate-orm/pull/6756