What is the recommended way for checking anonymous user access to a public page

I have content on a page that is publicly accessible, when the permission check is carried out by a user that is not logged in (anonymous user) using

/api/v2/pages/{contentEntityId}/operations

It returns a 404 even though the page should be publicly accessible.
Is there another way to make this check?