Is Settings::set() a valid function?
No, you can not call Settings::set. You should get an 

Error: Call to undefined method Drupal\Core\Site\Settings::set() in ...


Maybe there's something wrong with your error reporting or you imported any other Settings class (check your namespace). Check your php.ini for this. The Settings Class is for read-only access to the settings in settings.php.

If you need to set some system settings do it like this:

// themes
\Drupal::configFactory()-&gt;getEditable('system.theme')
-&gt;set('admin', 'bartik')
-&gt;save();