Simply put, the search form in the header returns hidden products. The full search page does not return hidden products. The issue is specific to the “Search form in header” option.
Is there a function or filter I can add or amend to restrict these results to publicly available products?