### Tested versions

A custom build of Godot 4.2.1.rc.mono, with the following `print_error` line added to the `./modules/mono/csharp_script.cpp`
```cpp
CSharpScript::~CSharpScript() {
#ifdef DEBUG_ENABLED
	MutexLock lock(CSharpLanguage::get_singleton()->script_instances_mutex);
	CSharpLanguage::get_singleton()->script_list.remove(&this->script_list);
#endif

	/*This line ------->*/ print_error("CSharpScript::Delete: " + get_class_name());

	if (GDMonoCache::godot_api_cache_updated) {
		GDMonoCache::managed_callbacks.ScriptManagerBridge_RemoveScriptBridge(this);
	}
}

void CSharpScript::get_members(HashSet<StringName> *p_members) {
#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
	if (p_members) {
		for (const StringName &member_name : exported_members_names) {
			p_members->insert(member_name);
		}
	}
#endif
}

/*************** RESOURCE ***************/

Ref<Resource> ResourceFormatLoaderCSharpScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) {
	if (r_error) {
		*r_error = ERR_FILE_CANT_OPEN;
	}

	// TODO ignore anything inside bin/ and obj/ in tools builds?

	Ref<CSharpScript> scr;

	/*This line ------->*/ print_error("CSharpScript::Create: " + p_path);

	if (GDMonoCache::godot_api_cache_updated) {
		GDMonoCache::managed_callbacks.ScriptManagerBridge_GetOrCreateScriptBridgeForPath(&p_path, &scr);
	} else {
		scr = Ref<CSharpScript>(memnew(CSharpScript));
	}
```

### System information

Godot v4.2.1.rc.mono (daeb1c729) - Windows 10.0.17763 - GLES3 (Compatibility) - NVIDIA GeForce RTX 4060 Ti (NVIDIA; 31.0.15.4601) - AMD Ryzen 9 5900X 12-Core Processor (24 Threads)

### Issue description

A CSharp script, as a dependency of a scene, sometimes will not get freed when closing that scene tab, based on the testing result, this issue occurs when:
1. There is more than one scene tab, and the closing scene is not the first scene tab.
2. There is only one scene tab.

I have found this issue in the process of identifying/addressing the [.NET: Failed to unload assemblies](https://github.com/godotengine/godot/issues/78513) issue, specifically the issue that prints the following error:
```
modules/mono/glue/runtime_interop.cpp:1324 - System.ArgumentException: An item with the same key has already been added. Key: Game.WeaponAbilityData
     at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
     at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
     at Godot.Bridge.ScriptManagerBridge.ScriptTypeBiMap.Add(IntPtr scriptPtr, Type scriptType) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.types.cs:line 23
     at Godot.Bridge.ScriptManagerBridge.AddScriptBridge(IntPtr scriptPtr, godot_string* scriptPath) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs:line 419
```

### Steps to reproduce

0. Add the mentioned line to the source code at the corresponding position, then compile the godot source with mono module enabled.
1. Open the included project, close any opened scene, then go to `Project/Reload Current Project`.
2. There are three behaviors this project can produce: `Expected`, `Error - MoreThanOneTab`, `Error - OnlyOneTab`

## Expected:
1. Open `scene_a.tscn`, print: `CSharpScript::Create: res://Script.cs`
2. Open `empty.tscn`
3. Close `scene_a.tscn`, print: `CSharpScript::Dtor: CSharpScript`
4. Close `empty.tscn`
Video:
https://github.com/godotengine/godot/assets/71481700/6c7f29ec-f292-4dea-ae62-cc4496720a14

## Error - MoreThanOneTab:
1. Open `empty.tscn`
2. Open `scene_a.tscn`, print: `CSharpScript::Create: res://Script.cs`
3. Close `scene_a.tscn`, nothing is printed (the script is not freed)
4. Close `empty.tscn`, print: `CSharpScript::Dtor: CSharpScript`, which is an unexpected behavior
Video:
https://github.com/godotengine/godot/assets/71481700/24ae4de6-d369-4479-8c53-398483c10403

## Error - OnlyOneTab:
1. Open `scene_a.tscn`, print: `CSharpScript::Create: res://Script.cs`
2. Close `scene_a.tscn`, nothing is printed (the script is not freed)
3. Close the `[empty]` tab, [nothing is printed (the script is not freed)](print: `CSharpScript::Dtor: CSharpScript`, which is an unexpected behavior)
Video:
https://github.com/godotengine/godot/assets/71481700/6340c65e-a2ac-4feb-85a1-ec6574be3b6f

### Minimal reproduction project (MRP)

[Issue Demo.zip](https://github.com/godotengine/godot/files/13626080/Issue.Demo.zip)

List<String> property_names;
						for (const PropertyInfo &E2 : pinfo) {
							if (E2.usage & PROPERTY_USAGE_STORAGE) {
								property_names.push_back(E2.name);
							}
						}
						
						for (const KeyValue<StringName, Variant> &E2 : E.value.property_table) {
							if (property_names.find(E2.key)) {
								modifiable_node->set(E2.key, E2.value);
							}
						}
						
						for (const ConnectionWithNodePath &E2 : E.value.connections_to) {
							Connection conn = E2.connection;
							
							Node *target_node = cast_to<Node>(conn.callable.get_object());
							
							
							
							if (!target_node || !target_node->is_queued_for_deletion()) {
								target_node = modifiable_node->get_node_or_null(E2.node_path);
							}
							if (target_node) {
								
								Callable new_callable = Callable(target_node, conn.callable.get_method());
								if (!modifiable_node->is_connected(conn.signal.get_name(), new_callable)) {
									ERR_FAIL_COND(modifiable_node->connect(conn.signal.get_name(), new_callable, conn.flags) != OK);
								}
							}