Unable to disable 'Restrict access to users with relationship to the contact'
The moment Restrict access to users with relationship to the contact
is enabled in the settings screen, it's impossible to disable it.
As workaround you can use a script to change the settings
drush ev 'civicrm_initialize() ; Civi::settings()->set("sharepoint_contact_restrict_access",0);'