It could be a driver configuration, what connector are you using? Or have you contacted your admin to verify if there is a timeout configured that maybe if a query exceeds specific amount of time the query is aborted?
Have you noticed if the error occurs only when the query is complex?
Kind Regards.
Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm