Until I found the “Display default error page” application property I struggled to debug XPages errors.
Now that that option has become my best friend I rarely encounter the old Error 500 HTTP Web Server: Command Not Handled Exception page.
Until I made a silly mistake.
This error will be displayed if your code enters an endless loop.
So if you’re getting Error 500 errors with the “Display default error page” option enabled, check your code for possible endless loops.