Did you ever find an answer to this problem?
Currently have the same issue in 9.6.1
I was getting the same issue, check the following:
1) poll the API to see if your results are ready (using qryGetStatus)
2) once your results are ready, proceed to fetch them, however, bear in mind that you can't "exit" your logon session with the API and then get the results: they only last as long as your session.
So if you want to get your results, you need to setup some sort of "while" loop in your script that will check qryGetStatus until a 100% value is reached, then fetch the results, all in the same scriptblock. That solved the issue for me, although I'm working with ESM 10.0.3