Although the error message is not as obscure as usual, it does not point directly at the problem, which can be a bit difficult to solve if we do not know well the capabilities of SharePoint.
The problem is that you have not set up the “Access Request Settings” for the current site.
This configuration is done at the “Site Permissions” in the “Site settings” section.
In group “Manage” you have the link “Request Access Settings”
By clicking this link, you can allow “access request” and specify the person’s email address where the request will be send and the “Share” will work properly.