Apparently the production environment contained some code that was different from our local environment. This code change was not tracked in Git and thus overwritten with each new deploy.
The issue was the HandleSSLRequests event. See here for documentation. The code from Git was not correct and it was only fixed on production directly.