### Godot version

v4.1.stable.official [970459615]

### System information

Godot v4.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XTX (Advanced Micro Devices, Inc.; 31.0.21001.45002) - AMD Ryzen 7 7700X 8-Core Processor (16 Threads)

### Issue description

When renaming a scene in specific conditions regarding inheritance, the scene is wrongly marked as corrupt or Godot just crashes.

The setup for the bug to happen involves having 3 scenes, one being within the other (forming a 1->2->3 order), having all 3 scenes opened in the editor, and then renaming the 3rd scene while scene 1 is open, causing the 2nd become corrupt or Godot to crash. This also occurs if the name of the folder where the 3rd scene is contained is changed, instead of the scene itself. I presume the path of the 3rd scene changing at all while the 1st scene is opened results in the bug.

Given that having multiple scenes with dependencies with each other seems to cause this bug, it is probable that his bug occurs _beyond_ the aforementioned 3-scene setup, but it is a scenario where the bug can be consistently reproduced. It could be that the bug described in issue #80324 is related if not the same as the one described here.

### Steps to reproduce

**Empty Project:**
1. Create an empty Godot project.
2. Create 3 scenes, each just being a Node. The contents of the scenes seem irrelevant beyond the dependencies explained in the following steps.
3. Make the 2nd scene a child of the 1st, and the 3rd a child of the 2nd.
4. Have all three of them opened, but have the 1st scene as the active one in the viewport.
5. Rename the 3rd scene in the File System.

**Minimal Reproduction Project:**
1. Open all 3 scenes in the project, but have the 1st scene as the active one in the viewport.
2. Rename the 3rd scene in the File System OR the folder containing it. Either works.

The 2nd scene should now be marked as corrupt, and the user will be unable to open it until Godot has been restarted. Alternatively, Godot will have crashed.

### Minimal reproduction project

[Rename_Scene_Bug.zip](https://github.com/godotengine/godot/files/12282031/Rename_Scene_Bug.zip)

_navigate_to_path(p_file);
}
void FileSystemDock::_file_multi_selected(int p_index, bool p_selected) {
	
	int current = files->get_current();
	if (current == p_index) {
		String fpath = files->get_item_metadata(current);
		if (!fpath.ends_with("/")) {
			current_path = fpath;
			if (display_mode == DISPLAY_MODE_SPLIT) {
				_update_tree(get_uncollapsed_paths());
			}
		}
	}
	
	import_dock_needs_update = true;
	call_deferred(SNAME("_update_import_dock"));
}
void FileSystemDock::_tree_mouse_exited() {