Error when executing query with multiple level joins

In prev version of hibernate query works fine, with 6.1.7 I got the error:
“Alias XXX used for multiple from-clause elements”
my query looks like this:

SELECT COUNT(adminPermission)
               FROM adminPermission
               LEFT OUTER JOIN adminPermission.allChildPermissions childPermission
               LEFT OUTER JOIN childPermission.qualifiedEntities childQualifiedEntity
               LEFT OUTER JOIN adminPermission.qualifiedEntities qualifiedEntity
               LEFT OUTER JOIN adminPermission.allRoles role
               LEFT OUTER JOIN role.allUsers roleUser
               LEFT OUTER JOIN adminPermission.allUsers permissionUser
               WHERE (roleUser = :adminUser OR permissionUser = :adminUser) AND
                     (adminPermission.type = :type OR adminPermission.type = 'ALL' OR 
                     childPermission.type = :type OR childPermission.type = 'ALL') AND
                     (qualifiedEntity.ceilingEntityFullyQualifiedName = :ceilingEntity OR childQualifiedEntity.ceilingEntityFullyQualifiedName = :ceilingEntity)

Debugged hibernate a bit I see a strange behavior:
so it finds condition (roleUser = :adminUser OR permissionUser = :adminUser) and starts to process joins…
It finds join
LEFT OUTER JOIN role.allUsers roleUser
with alias roleUser which seems correct, now it does some recursive magic where it parses variable “lhs” which is another join
LEFT OUTER JOIN adminPermission.allRoles role
processes it, adds to some registry map alias “role”
and checks that join has a reference to the “first join”
LEFT OUTER JOIN role.allUsers roleUser
and processes it - now we have in some registry map aliases: role, roleUser
recursion ends and it continues with “first join”
attempts to put it to that alias registry map, but it is already there and says that roleUser is used for multiple from-clause element…
Some of relationships are mapped with OneToMany some with ManyToMany through JoinTable

Am I doing something wrong ?

This looks like a bug. Please create an issue in the issue tracker( with a test case(hibernate-test-case-templates/ at main · hibernate/hibernate-test-case-templates · GitHub) that reproduces the issue.

Thanks, created issues: [HHH-16582] - Hibernate JIRA
Also seems the problem is that in my project interfaces are widely used, without interfaces it works ok.