Hibernate rearrange the joins from a JPAQuery in a wrong way, after translating the query to SQL

I have a code like this.

queryFactory.select(...)
    .from(A)
    .innerJoin(B).on(A.b.eq(B))
    .innerJoin(C).on(A.c.eq(C))
    // ... some other joins which depends on C ...
   .where(...)
   .fetch();

I am expecting to get a SQL Query which looks something like that:

select ... from A
    inner join B
         on A.b.id = B.id
    inner join C
         on A.c.id = C.id
   //... some other joins which depends on C ... 

but Hibernate rearranges the joins which causes error in the SQL and the SQL Query looks like this:

select ... from A
    inner join B
         on A.b.id = B.id
    //... some other joins which depends on C ... (don't have C at this point)
    inner join C
         on A.c.id = C.id

The problem cames after updating Hibernate from 5.4.32 to 6.1.6

Please create an issue in the issue tracker(https://hibernate.atlassian.net) with a test case(hibernate-test-case-templates/JPAUnitTestCase.java at main · hibernate/hibernate-test-case-templates · GitHub) that reproduces the issue.

the Class A looked like this:

@... // Some Annotations
public Class A {
     @ManyToOne
     @JoinColumn(...)
     @NotFound(action = NotFoundAction.IGNORE)
     private B b;

     @ManyToOne
     @JoinColumn(...)
     @NotFound(action = NotFoundAction.IGNORE)
     private C c;
  
   // ... some other attributes ...
}

After removing “@NotFound(action = NotFoundAction.IGNORE)”, it works fine.