Long runtime batch scripts, 520 Error and Page Rules

The maximum response time from your origin is 100s (on Enterprise plans up to 600s). However, the error for exceeding this is 524, so that is probably not happening here.

Have you reviewed the #Community Tip for troubleshooting 520 error issues?