Using ADB to change the screen lock
Since Android 8.0 Oreo, you can change the lock screen using below adb commands

adb shell

athene_f:/ $ locksettings
usage: locksettings set-pattern [--old OLD_CREDENTIAL] NEW_PATTERN

   locksettings set-pin [--old OLD_CREDENTIAL] NEW_PIN
   locksettings set-password [--old OLD_CREDENTIAL] NEW_PASSWORD
   locksettings clear [--old OLD_CREDENTIAL]
   locksettings verify [--old OLD_CREDENTIAL]
   locksettings set-disabled DISABLED
   locksettings get-disabled

flags:
   --user USER_ID: specify the user, default value is current user



locksettings set-pin: sets a PIN
locksettings set-password: sets a password
locksettings clear: clears the unlock credential
locksettings verify: verifies the credential and unlocks the user
locksettings set-disabled: sets whether the lock screen should be disabled
locksettings get-disabled: retrieves whether the lock screen is disabled


And if you want to remove the password, just use below code:

$ locksettings clear --old old_password_put_here


Here is the reference link: The Android Soul - How to change or remove lock screen pattern, PIN or password via ADB on Android 8.0 Oreo

I have tested on Android Oreo device. It works just fine.