I get this CORS error when I try to access a Netlify function (deployed to Netlify through GitHub) from my website (also deployed to Netlify). This is a simple contact function, send an email through the contact form. My domain is from Google Domains.
Generally speaking, if someone is visiting your page at the custom domain (www.mygoogledomain.com) and you make an API call to the site subdomain under netlify.app (like quizzical-abcd-abcd123.netlify.app) then you are not using the same domain name and you are going to trigger CORS errors if there is a CORS policy in place (unless the CORS policy specifically allow this). If you want to learn more about CORS, there is a StackOverflow post here:
Also, the MDN documentation on CORS is amazingly well written (in my opinion at least):
That should automatically use the correct domain name. If that doesn’t work, please let us know. Also, if you send is a link to the actual site (or tell us the API ID for the site), we can take a look at the headers you are sending.