While this test runs just fine on H2, on PostgreSQL, it fails with the following error message:
The query in question looks like this:
It could be because the human2_2_ alias is referenced in a JOIN ON clause before it's being declared in an INNER JOIN as an alias.
Applied PR upstream.
Fixed in 5.1 as well.