Automatically hide and show the dock is greyed out, how to reactivate the option?

I have been using macOS Catalina since its release but today the Dock suddenly refuses to hide. In the preference pane, the Automatically hide and show the Dock option is greyed out.

I have tried killall Dock which hides the dock for 1 second, then it comes back.

Option Greyed out

macOS details OSX Catalina 10.15.5 (19F101) Mac book pro 16" 2019


I have run into a solution, thanks to idownloadblog

just put the code below into terminal

defaults write com.apple.dock autohide -bool true

It overrides the setting in preference