MacOS 10.13.4 Cannot turn off lock screen in system preferences
I was stumped with some issues for days now, reading everything I could on the subject, and I finally found the solution: it is a keychain problem with as simple solution.

The solution is to delete one or more folders located in ~/Library/Keychains/, that is to say folders in the Keychains folder in our user Library.

The folders to be deleted have long names like: A8F5E7B8-CEC1-4479-A7DF-F23CB076C8B8.

You may have one or more folders with these long names and they can be safely deleted: one such folder will be recreated after rebooting.

Do not remove anything else contained in you Keychain folder, and reboot.

Once rebooted, reinstall all extensions in Safari, and/or enable other features you we having issues with.

Trashing those folders solves many issues such as:


Security login screen system prefs not recognizing your changes &amp; your password (locks the screen immediately on sleep or screen saver);
Safari disabling all your extensions and not recognizing your password if you try a solution in the developer's menu;
iCloud system prefs not wanting to enable your iCloud Keychain and complaining it can't communicate with the iCloud server;
Safari not recognizing your password when you try to access the passwords tab in Safari preferences;
Login screen disregards Automatic Login settings and insists on asking  for a user password.


——

I found this solution at TechRaptor (thanks!), although at first it seems a bit unrelated (many screen captures in article): The Iron Mac: How to Get Rid of Annoying Local Items Keychain Box.