Hello Martin and Andrew,
I took the same scenario on my instance, I reproduce the same bug. Indeed, the error is the following:
{
"error": {
"code": "0x8006088a",
"message": "Resource not found for the segment 'RetrieveSharedPrincipalsAndAccess'.",
"innererror": {
"message": "Resource not found for the segment 'RetrieveSharedPrincipalsAndAccess'.",
"type": "Microsoft.OData.UriParser.ODataUnrecognizedPathException",
"stacktrace": " at Microsoft.OData.UriParser.ODataPathParser.CreateDynamicPathSegment(ODataPathSegment previous, String identifier, String parenthesisExpression)\r\n at Microsoft.OData.UriParser.ODataPathParser.CreateFirstSegment(String segmentText)\r\n at Microsoft.OData.UriParser.ODataPathParser.ParsePath(ICollection`1 segments)\r\n at Microsoft.OData.UriParser.ODataPathFactory.BindPath(ICollection`1 segments, ODataUriParserConfiguration configuration)\r\n at Microsoft.OData.UriParser.ODataUriParser.Initialize()\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer, Boolean template)\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(String serviceRoot, String odataPath, IServiceProvider requestContainer)\r\n at Microsoft.Crm.Extensibility.ODataV4.Routing.CrmODataPathHandler.<>c__DisplayClass1_0.b__0()"
}
}
}

So I did some more research so that I could correct the problem:
Xrm.webApi add a parameter to the request:
yourOrganization.crm4.dynamics.com/.../RetrieveSharedPrincipalsAndAccess(Target=@Target,getMetadata=@getMetadata)?@Target={"@odata.id":"accounts(43488de2-195e-ea11-a811-000d3a45bff9)"}&@getMetadata=null
The error does not occur again after manually removing this parameter from the request .

I don't know if it's a system bug. Maybe Andrew can shed some light on that.
Edit:
https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/retrievesharedprincipalsandaccess?view=dynamics-ce-odata-9
RetrieveSharedPrincipalsAndAccess function normally accepts only one parameter.