DTS_E_OLEDBERROR. Error code: 0x80004005.Difference between SQl Native client and oledb provider for sql server

I ran into this issue after releasing a new SSIS project to the production environment.

At first, I was able to validate the package with success, but when I tried to execute the package, I got the DTS_E_OLEDBERROR. Error code: 0x80004005. message.

I tried to validate the package with the servername and password variables set to sensitive, but in this case the validation failed as well.

After setting the environment variables back to non-sensitive again and inserting the environment variable values, I was able to validate and execute the package.

To me it seems like in some cases the metadata in the SSISDB gets corrupted, but unfortunately I've not been able to point down the source of this issue.

I hope this will help someone. I've went through a lot of debug scenarios before I ended up with this (rather unsatisfying) solution.