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

    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },

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.