The solution that has been provided is excellent: the pdf reader still has a dark grey background and then there is a light grey bar around the document that distinguishes it from the inverted document (in most cases inverted from white to black in night mode). So the issue is mostly solved and I want to say it works like a charm.
However, I noticed that this feature only works for in-website pdfs that are opened on the local website itself. If a pdf is for example downloaded and later opened with the pdf viewer from the browser, it will not work. So if the pdf file is opened directly from the user's own disk (the C disk for example), Midnight Lizard will not work. Probably because it does not have these permissions. I am guessing this has to do with extension safety and browser safety.
Would it be possible to use a pop-up instead, in which the user can grant Midnight Lizard file access to the relevant local pdf? This file access would only be granted to the specific local file (not the entire folder) and only for the duration of the browser session. Afterwards the permission will be erased and there will again be an option within Midnight Lizard to grant permission. This is a small hurdle to make sure even local pdfs can be read in the inverted dark mode that was so perfectly designed a while ago.