Matomo Preflight request causing CORS error, randomly

'm not entirely sure what’s going on, but it seems we’re encountering a CORS error mismatch. This is happening because our preflight request is missing the Access-Control-Allow-Origin header. From what I understand, the preflight request is triggered because Matomo is using the OPTIONS request method. I’ve following this link, but the issue still remains.
https://matomo.org/faq/how-to/faq_18694/. to define randomly, it’s happening for most end users, but not all.

I’m honestly unsure how to resolve the CORS issue.

“Ensure CORS response header values are valid”