How do I fix a 401 error when my email-sending worker is run by visiting my site?

What is the name of the domain?

https://sgtg3app.uk/

What is the error number?

401 error

What is the error message?

“Authorization Required”

What is the issue you’re encountering

Whenever I visit the webpage, there should be a message going to a specific email when I load the page, but I get the error instread.

What steps have you taken to resolve the issue?

Sendgrid has authenticated both the emails and the url.
I have put in the dns records for the url.
I have tested if the basic “Hello world” function works (it does).
I have tried to check the “www authentication”.
However, I cannot find it when I use inspect element. I suspect that might be an issue.
I have checked the website on private browser so that anything like cookies wont be a problem.
I flushed the dns.

What are the steps to reproduce the issue?

Visit the website.

Screenshot of the error