Can I set value like
As if we can get value using
Settings::get('some-variable') then why the '
set' method is not working?
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()->getEditable('system.theme') ->set('admin', 'bartik') ->save();