### Godot version

4.0.1stable

### System information

Windows 11

### Issue description

I had a project that previously contained multiple folders, scripts, scenes, etc. However, I decided to delete everything except for a MeshInstance3D node and its associated script in order to start something new from that. The MeshInstance3D node has a material_overwrite property set with a shader material that was originally located in one of the folders I deleted carelessly.

Now, whenever I try to save the scene, the previously deleted "shader" folder reappears in the project directory. However, when I try to click on the folder, the entire project freezes before eventually crashing. 

I created a new project and attempted to attach a Shader Material, stored in a folder, to a MeshInstance3D node. I deleted the original folder that contained the shader material, and then saved the scene. The previously deleted folder did not reappear in the project directory, I was unable to reproduce the issue and I believe that the data stored in the scene is responsible for that behaviour. I have my own project folder that make it happen consistently which I'll join.

### Steps to reproduce

Just import the project and once it is opened, press "ctrl + s" to save, that will make a folder named "Shader" appear, if you click on that folder everything will freeze before eventually crashing.

### Minimal reproduction project

[reproduction_project.zip](https://github.com/godotengine/godot/files/11255484/reproduction_project.zip)

emit_changed();
}
void ShaderInclude::set_code(const String &p_code) {
	code = p_code;
	for (const Ref<ShaderInclude> &E : dependencies) {
		E->disconnect_changed(callable_mp(this, &ShaderInclude::_dependency_changed));
	}
	{
		String path = get_path();
		if (path.is_empty()) {
			path = include_path;
		}
		String pp_code;
		HashSet<Ref<ShaderInclude>> new_dependencies;
		ShaderPreprocessor preprocessor;
		Error result = preprocessor.preprocess(p_code, path, pp_code, nullptr, nullptr, nullptr, &new_dependencies);
		if (result == OK) {
			
			dependencies = new_dependencies;
		}
	}
	for (const Ref<ShaderInclude> &E : dependencies) {
		E->connect_changed(callable_mp(this, &ShaderInclude::_dependency_changed));
	}
	emit_changed();
}
String ShaderInclude::get_code() const {
	return code;
}
void ShaderInclude::set_include_path(const String &p_path) {