Hi @frob ,
Please make sure you have enabled “Anyone” external sharing settings at both the organization level and the site level. If the Sharing policy for your SharePoint Online tenant or site is set to “Existing guests – Only guests already in your organization’s directory”, You must invite the external user to your Azure AD first in order to provide them access. To allow external sharing on any site, you must allow it at the organization level.
You have to enable “Anyone with the link”.
1.SharePoint admin center > Policies > Sharing
2.SharePoint admin center > Site>Policies> External sharing> Edit
References: External sharing overview
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.