I've used the following powershell script to change the default access denied page for my web Application:
Set-SPCustomLayoutsPage -Identity "AccessDenied" -RelativePath "/_layouts/Custom/AccessDenied.aspx" -WebApplication "MyWebApp"
My Web Server (wfe) is behind an UAG server and I receive the following error: This error (HTTP 403 Forbidden) means that Internet Explorer was able to connect to the website, but it does not have permission to view the webpage.
(My custom AccessDenied.aspx page is based on a custom application page OOTB VS2010)
Update: When I copy paste the OOTB AccessDenied.aspx page and make a small change, this error does not come up and the page is displayed correctly... It looks like an issue with the master page it's using, when using the simple.master I have no problems, when you try to apply a custom or default the error pops up