Hi Petez11,
I hope you have the QC client or the connectivity addin installed in the macine from where you are try to execute the script.
Please check the below site configuration parameter values that have been set in your environrment.
REPORT_QUERY_RECORDS_LIMIT
REPORT_QUERY_TIMEOUT
CLEAN_PROJECT_CACHE_INTERVAL