When I was doing a survival, I locked the difficulty to keep me form cheating like resetting mobs and creative, but when i tested /difficulty the difficulty it would change even though it was locked. By the way, I love with minecraft and don't ever stop making updates! Cant wait for 1.12!
This isn't a bug, /difficulty is a command that only works when cheats are turned on, it is supposed to override locked difficulty so that you can change it on servers where its always locked