Zend certified PHP/Magento developer

Getting “Class not found” in bitbucket pipeline issue

In my build from my pipeline, I am receiving this error:

  Fatal error: Uncaught Error: Class 'SwaggerClientApiProductsApi' not fou  
  nd in /opt/atlassian/pipelines/agent/build/app/code/Namespace/ModuleName/Model/Api/ProductsApi.php:16 

when it comes to run bin/magento setup:di:compile. But when I run locally the setup:di:compile command , I don’t get any errors! It happens only during the pipeline deployment.

Does anyone have a clue about this ?