How to make a private file visible after changing file URI?
It sounds like Drupal is telling the browser that the PDF file is an image.

When you're modifying an existing file entity, File::save() will not change the filemime property of a file automatically. Drupal only does this during execution of ::preCreate(). 

The filemime property isn't being used when serving from the public dir, but is being used when serving from the private dir (where Drupal is serving the headers/payload instead of your web server). 

Try executing $file_entity-&gt;setMimeType('application/pdf') or create a new file entity with your PDF artifact.