Magento 2.3 to 2.4 upgrade issue: ‘Zend\Mvc\Controller\LazyControllerAbstractFactory’ not found

If you come across an error ‘Zend\Mvc\Controller\LazyControllerAbstractFactory’ not found while running bin/magento setup:upgrade Update your autoload section in composer.json with the following data and run composer dumpautoload then remove generated code and cache contents using the below command rm -r generated var/page_cache/* var/cache/* now run bin/magento setup:upgrade and the issues should be fixed.