I've found the solution.
Since the redirect is still in place the actual data is never outputted. When I exit(0) after the stream, then the PDF is outputted.
exit(0)