Missing parentheses in Criteria API when accessing array

Hello dear community,
I have a problem with accessing an array element directly after creating it when using the criteria API.

Here a simple example:

        query.orderBy(
            builder.asc(
                builder.arrayGet(
                    builder.arrayAgg(null, root.get<String>("name")),
                    1
                )
            )
        )

This generates the following ORDER BY clause
ORDER BY array_agg(e1_0.name)[1]

The problem is, this cause an error “ERROR: syntax error at or near “[”” because there are no parentheses around the array creation. A correct example would look like this:
ORDER BY (array_agg(e1_0.name))[1]

Is there a way to access the array correctly?

Please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.