As reported here https://stackoverflow.com/questions/76351608/joining-ctes-in-hibernate-6-2 it should be possible to join two CTEs.