3rd Party REST API call within .NET DLL failing when DLL is being called through automation

We have an architecture where we are using a .NET DLL to query the database and then send the queried data to a 3rd party using a REST API call. We are calling this particular DLL through an Verint Automation.

When we call the 3rd party REST endpoint through the automation directly, it just works.

However, when we try calling the same API through the DLL and the DLL is being called in the automation, it doesnt work. Commenting out the REST API call in the DLL makes the DLL work as expected and execute the rest of the code.

Has anyone faced this issue? Any clues around what is the cause?