I have changed the Joomla backend for server error reporting to none as you suggested.
When I restarted the web site and tried to download with my old setting, I still got the same error:
Failed to connect to the web site, ERR_INVALID_RESPONSE
I kept your export.php unchanged.
Could you please advise?