DOIs can be created by one of several Registration Agencies. The Unpaywall dataset only covers articles issued by one: Crossref. If you're looking for a DOI that isn't in Unpaywall, it might be invalid or created by a different agency. In either case, the Unpaywall REST API will give a 404 response, the Simple Query Tool will have a blank row, and it will be absent from the database snapshot.
You can find out if a DOI is valid by checking the doi.org proxy server REST API, and you can find out which Registration Agency created a valid DOI using Crossref's agency endpoint. From the Crossref API docs:
Some valid Crossref DOIs aren't included because they've been deleted or are used for testing. For example:
We used to include DataCite DOIs, but we don't anymore. In practice we added very little value because almost everything with a DataCite DOI is OA. We decided to remove them at a time when article access was the primary use case for Unpaywall, and going to the doi.org URL is virtually guaranteed to give you that. Essentially, all we could do was be wrong, and we had an ever-growing list of exceptions people told us were closed. As Unpaywall is increasingly used for OA policy audits and analyses, the case for including them is stronger. For now, for statistical purposes, if you have a DataCite DOI, it's OA.