Might be a duplicate, but couldn't find this exact question here.
I have a pretty basic 404.twig template that should be catching things, as described here: https://docs.craftcms.com/v3/routing.html
It works as described on my local environment but I'm getting the generic Craft "Internal Server Error" page on my staging site.
devMode is set to false on both environments, and there is no error prefix specified as in this post: Craft not loading custom 404 template for errors
I checked the web-404s log and confirmed that Yii is throwing a NotFoundHttpException when I test pages. I'm not sure what else I should check. Any ideas?