My scenes wont save when i try to save them.

Godot Version

4.5.1

Question

When i try to save my scenes it says: Unable to write to file (file), file in use, locked or lacking permissions

Please paste here the code snippet that is responsible for saving logic.
Use preformatted text with triple backticks ``` at the beginning and end of the snippet.