I have implemented a customised error pages using acs-commons approach for SPA to capture 404 and 500 errors on AEM. The 404 pages are working fine with this approach but we are facing issues with implementing 500 errors. We have followed this documentation/ github approach https://github.com/niekraaijmakers/aem-spa-editor-errorpages-example#404-pages
The basic problem which we are facing is that we can't set the structureDepth to "0" for 500 error pages at the root level as it will not include the child pages and there will be just one page in entire spa application.