The ‘Iterator ID is not valid’ error occurs when Quickbooks takes too long to fetch a single page of data. When this happens, the iterator id can be invalidated before the complete data is returned.
You can solve this in two ways:
Decrease the PageSize connection property in your QuickBooks connection
Increase the idle timeout and enable persistent connections in your QuickBooks Desktop Gateway (previously known as the Remote Connector). You can find documentation for this here https://cdn.cdata.com/help/RQJ/odbc/pg_rcadvanced.htm