Why do the ProjectSettings not save after changing in code?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MaaaxiKing
ProjectSettings.set_setting("application/run/main_scene", "res://title_screen/title_screen.tscn")
ProjectSettings.save()

For whatever reason, it does not work, even if I disabled safe save in Editor settings as suggested. And I’m also not running a paranoid antivirus.

I put the set_setting line into assert and the program stopped. But from where should I know the error’s reason?

MaaaxiKing | 2021-02-22 08:55

I get an error printed:

E 0:00:02.594   _save_settings_text: Couldn't save project.godot - project.godot.
  <C++ Error>   Condition "err != OK" is true. Returned: err
  <C++ Source>  core/project_settings.cpp:755 @ _save_settings_text()
  <Stack Trace> tutorial.gd:35 @ next()
                tutorial.gd:28 @ _input()

MaaaxiKing | 2021-02-22 09:53