There's endless possibilities without seeing all your code and knowing your environment.
High level things to check:
- Make sure you are making the call over LDAPS if your Domain Controllers are configured this way. Sounds like you already are.
- Make sure you can change the password manually. There are likely password policies preventing certain passwords length/reuse/complexity.
- Try to bind with an account with higher privileges than the account you are trying to change the password on.
- Connect directly to the PDC emulator.
I would also try the same operation using ldp.exe as it may work and narrow down the issue. Or it may fail with a better LDAP code.