Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
This feature is available in Azure Front Door.
See : Configure a custom response for Azure WAF for AFD
But not in Application Gateway as of now.
While you can still create a custom error page, you cannot create a custom error response with details from App gateway logs.
See : Create Application Gateway custom error pages
Should you be interested in this feature, you may vote in Azure Feedback Hub forum requesting this feature.
All the feedback shared in these forums are monitored and reviewed by the Microsoft engineering teams responsible for building Azure
Refer : https://feedback.azure.com/d365community/forum/8ae9bf04-8326-ec11-b6e6-000d3a4f0789
Hope this helps.
Cheers,
Kapil.