I was wondering if there exists a way to customize the Out of the Box Access Denied page, or Redirect it to custom access denied page in SharePoint Online. So far I haven't found a way, and Microsoft community only has one such question, where the answers are that Redirecting or having a custom Access Denied page is not possible in SharePoint online. Is this confirmed or is there a way?
I don't believe it's possible in SharePoint Online. There are multiple threads including one where a Microsoft employee also stated it wasn't possible:
There is also a feedback item on the Microsoft Feedback portal for it. I would recommend voting for it, if you would like to see this functionality: