Multiple values in SQL for Execute Query to excel

Thanks. but now received the below error message

Why sometimes when running Execute Query shows Execute Query: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Sometimes I set Connect Timeout=5000 somestimes Connect Timeout=50000
so sometimes it works sometimes it doesnt work?