A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
There is no such way to customize the error message in SharePoint online when users have no access to pages.
This error message is hard code generated by Microsoft and we could not customize it.
If an Answer is helpful, please click "Accept Answer" and upvote it.
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.