How to setup a 404 action/view in Slim 4?

when I try to change return return $this->responder->render( to return $this->view->render( by adding Twig into this Middleware, getting errors like Uncaught Twig\Error\RuntimeError: Unable to load the "Slim\Views\TwigRuntimeExtension" runtime.

The reason why I change this is, Twig Template not rendering twig variables and blocks instead of printing it.

How to solve this?