Hello,
The header search and the search field on the 404 page are pulling results from different sources. The header search is configured to search for all post types, while the 404 page search is set to return blog posts.
To make them consistent, you’ll need to adjust the search form used on the 404 template so it queries the same post types as the header search. Once both are aligned, you’ll get the same results across the site.
Try to create a custom sidebar and add the search widget from Appearance -> Widgets and check how it works.https://postimg.cc/1fHRGnDm
Best Regards,