Hi @VivekSr1
You are right, overlaying the OOTB servlet handler will do this across the environment. Instead you can leverage the ACS AEM Commons Error page handler for this requirement. Refer below links for details -
https://adobe-consulting-services.github.io/acs-aem-commons/features/error-ha...