Mezzio swoole migration and stateless services

Hi all! I am experimenting a porting to swoole of our company php framework, built around mezzio. Reading the documentation for mezzio-swoole I’m a little concerned about the need for stateless services. Refactor of all our legacy code base is too much work! In our code we extensively use the Laminas ServiceManager as DI container, so my idea is to rebuild a new segregated container instance on every request, this could be easily achieved with a replacement of the Mezzio\Swoole\Event\RequestHandlerRequestListenerFactory … something like this (Wire is the namespace of our framework):

 <?php
 
 declare(strict_types=1);
 
 namespace Wire\Swoole\Event;
 
 use Mezzio\Swoole\Event\RequestEvent;
 use Mezzio\Swoole\Event\RequestHandlerRequestListenerFactory as EventRequestHandlerRequestListenerFactory;
 use Psr\Container\ContainerInterface;
 use Wire\Bootstrap;
 
 final class RequestHandlerRequestListenerFactory
 {
     public function __invoke(ContainerInterface $container)
     {
         return function(RequestEvent $event) {
             // Initialize a new container to segregate request
             $container = Bootstrap::getInstance()->init(true);
             $app = $container->get(\Mezzio\Application::class);
             $factory = $container->get(\Mezzio\MiddlewareFactory::class);
         
             // Execute programmatic/declarative middleware pipeline and routing
             // configuration statements
             (require 'config/pipeline.php')($app, $factory, $container);
             (require 'config/routes.php')($app, $factory, $container);
 
             // Now go on
             return (new EventRequestHandlerRequestListenerFactory())($container)($event);
         };        
     }
 }

Do You see any problems with this kind of approach?