This is very interesting, this error a very strange one, normally this mean that there was an issue with the download of the resources, which could be due to a few things such as network issues, incorrect URL, or issues with the server.
What are you ...
Something does not seem right here, i would suggest asking TAC on this one as you have tried a few options and now the API endpoint need to be inspected to see why this differs so.
What happens if you collect total client count without any filters and compare it to the GUI/WLC to isolate whether the issue is with the filtering logic, same?
Wild guess, check if the API is returning real time data or aggregated data over a specific time period. I had a look at the docs quick, but could not see any notes on data refresh intervals.