#TIMEOUT errors are returned when a formula takes too long to run. See the following specific cases.
This formula exceeded the maximum allotted execution time. Try running the formula again.
This Python formula exceeded the maximum allotted execution time.
Try running the formula again or resetting the Python runtime. From the Formulas tab, in the Python group select Reset runtime, or use the keyboard shortcut Ctrl+Alt+Shift+F9.
You can also adjust the Python timeout limit. Go to File > Options > Advanced > When calculating this workbook and set Python Formula Timeout as desired.