When changing the difficulty via the server console, the in-game difficulty on the button updates if you go back and then click World Options again. If you click the game rules button instead and go back, the difficulty does not update on the button.
Reproduction Steps:
Start a server
Join and open Options > World Options
In the server console, type a difficulty command that changes the difficulty to something else
In the game, click Edit Game Rules and then Done or Cancel
You’ll see the difficulty not visually update.
Thank you for helping us improve Minecraft! We saved your files: