I have a 2019 on-prem site that uses publishing and a custom web page to return search results. When signed in, it works great. The site has anonymous enabled, and it woks great for browsing the site. But the search results web part gives the following error for anonymous user: The current user does not have permissions to create a QueryProperties template from "querygroup://webroot/Pages/Search.aspx?groupname=Default".
I can create a sub-site as an enterprise search center, make it anonymous, and its fine. Same with a basic search center. Same with new sites. ShareGate was used to migrate the site from 2013. This is using OTB web parts for the search box and results.