Credential Provider Error: PDKTC511E Failed to prepare data when running PowerShell script

My organization uses TeamCity for it’s CI/CD process. The deploy script is written with PowerShell scripts and during the deploy process it retrieves passwords from our CyberArk instance. We recently upgraded Credential Provider and now the deploy script is failing with the following error:
PDKTC511E Failed to prepare data
I can’t really find any information about this error online. The exact same script was working before the upgrade. Furthermore, I’m able to successfully retrieve a password with the exact same command when I enter it into the PowerShell CLI. I’m not sure what could be the issue.
Checking to see if anyone has any suggestions.