This is an ArcGIS Map Service which allows query.
I am applying a geometry filter in the query, when I set ResultOffset =0 and resultRecordCount=500, it only returns 36 records

If I remove these parameters in the query, it returns all the features intersects with the geometry:

This only happens to the ArcGIS Server Service, if the service is hosted in the ArcGIS Enterprise Portal, it works OK.
Any idea what's happening?
Thanks.