when the execution arrive to the hook template_redirect, wordpress has already send the 404 status code.
template_redirect
then when you send the PDF file, you need to set the status code again with status_header(200);.
status_header(200);