Are you trying to change the local admin account?
Verify that account you're trying to modify:
- exists
- isn’t disabled
- isn’t locked
And, lastly, that your account has local admin rights (and you run the code from an elevated PowerShell session -- i.e., start the session with "Run as administrator").