Setting dock position to immutable not working
I have tried the setting and this works fine with macOS 10.12 Sierra:

defaults write com.apple.Dock contents-immutable -bool yes; killall Dock

edit: sorry, I misread the command. The command to lock the position works too:

defaults write com.apple.Dock position-immutable -bool yes; killall Dock