There is an issue with the parameter returnDistinctValues:true. If I make a query with the following parameters:
- where: 1=1
- returnGeometry: false
- spatialRel: esriSpatialRelIntersects
- outFields: city
- returnDistinctValues: true
- orderByFields: city
- outSR: 102100
- resultOffset: 0
- resultRecordCount: 1000
The result of the query is the following:

As you can see the parameter returnDistinctValues doesn't work. How can I fix this issue?
Thank you in advance for your help. :)