We have noticed your form has close to 5000 rows. Please note the form times out due to the large number of rows in the form. Even if the error is thrown the form may still upload but it will not work optimally and will bring issues during analysis, exports or any other use.
There were also spaces in some of the relevant function you had defined for Q4 and also the == signs. The recommendation would be splitting the form into 2 or three forms as having it with so many rows will cause the 504 timeout error.