If you encounter such an error while creating a link:
Take a look into your space permissions, and make sure External Share for Confluence user has access to your space.
Go to Space Settings → Space Permissions → Individual Users
These permissions are the default for External Share for Confluence. It guarantees the correct operation of all functionalities - such as adding comments and attachments