the requested class did not generate properly, then you must add the generated class object to the signature of t he related construct method, only. code example
Example: magento 2 The requested class did not generate properly, because the 'generated' directory permission is read-only
sudo chown -R youruser:www-data /generated