The system check you have no bin inventory to let you disable the "Bin mandatory" option, and it check if you have no location inventory to enable it.
I'm not sure why you were able to enable Bin Mandatory while you have inventory on the location without bin
BTW you should be able to correct this following :
First remove all bins inventory related to your location (note item/qty somewere) then you will be able to disable "Bin mandatory". Then you will be able to remove location inventory (note items/qty somewere). Then you will be able to enable back "Bin mandatory" then you will be able to refill the bin inventory.
An alternative would be to set the Bin mandatory value to false in SQL time to remove the location inventory and set it back to true after that.