It wasn’t easy, but I finally managed to reproduce the problem inside the ORM codebase: https://github.com/hibernate/hibernate-orm/pull/6145