The default value for the timeout in the Advanced Settings Tab is 30 seconds. That means that after 30 seconds of execution of the query, the process will timeout no matter the state of completion of the query. Therefore, if the query takes longer than 30 seconds to execute due to the amount of data or for other reasons, then the Timeout property in the Advanced Settings tab should be changed to something other than 30 seconds.
The best option here is to make Timeout = 0, because Timeout set to 0 will make the query run until it fully completes or until it encounters an error. It is essential that you hit the "Save Changes" button before you proceed in order to save the new Timeout value.