Hey Josquin,
We have seen an issue like this before. Can you confirm that the account used to create the credentials is also the account running the script? If you are intending for a service account to run this script, make sure that the script is set to run as that service account. When you are generating these credential files, run Powershell as the service account and use that instance to generate the files.
In our situation, we didn’t generate the credential files with the service account so it was causing this error for us.
Thank you,
- Zach