error 500: Premature end of script headers: index.php
@mcaleaa answer helped me on an acquia based site. To fix it I commented out the following lines in development.services.yml:

parameters:
  http.response.debug_cacheability_headers: true