jamf changePassword failing on some Macs but not on others


Hello everybody,

I have a script running for years that changes the "localadmin" password once a day and records it in JAMF Pro. Recently I noticed that it fails on some (Intel Macs) but not on others (M1 for now).

What I do is to read the current password from Jamf and check if it is valid using

dscl . -authonly localadmin AFEBHq7jCspx

I then run the following command to change it

/usr/local/bin/jamf changePassword -updateLoginKeychain -username localadmin -oldPassword AFEBHq7jCspx -password rjBAVVW25UYw

and on my Intel Macs I get a "There was an error. One of the parameters provided is invalid". The M1 Mac seems to be fine for now.

Did anybody run into this issue in the past and provide any hints on how to resolve this?