The scene in Godot is overwritten, but the overwritten version only appears after I re-enter it

Godot Version 4.3

I’m creating a save system for my game and to save the positions of objects I chose to save the entire scene in .tcsn format. I have a starting scene TEST which I save to a new scene TEST NEW to save. When I try to access the overwritten scene, I only end up in TEST NEW which I saved first. Further saves overwrite the first one, but I can enter them only after re-entering the game. I stay in the editor all the time and do not restart it. I assume that Godot caches data about the scene and even if it is overwritten it still does not forget it. The question arises, how can I clear the memory of the previous version of the scene through code?

Please share your code, it always helps to understand what you’re doing and what you’re trying to achieve.
In general, it’s recommended to save game state using ResourceSaver, ConfigFile or JSON and File to save.
Here’s a good overview of all methods.