I narrowed down the problem. It seems to happen when I join entities A and B, and B is a child of C and inheritance between B and C is "JOINED".
It also turned out that the error goes away if I upgrade to boot 3.1.1 (which uses hibernate 6.2.5).
Long story short: I probably bumped into an already fixed bug which is present in boot versions 3.0.0 - 3.1.0.
Anyway, the narrowed down minimal example is here
https://github.com/riskop/20251017_complicated_criteria_query_problem