### 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)

Error result = preprocessor.preprocess(p_code, path, pp_code, nullptr, nullptr, nullptr, &new_include_dependencies);
		if (result == OK) {
			
			include_dependencies = new_include_dependencies;
		}
	}
	
	String type = ShaderLanguage::get_shader_type(pp_code);
	if (type == "canvas_item") {
		mode = MODE_CANVAS_ITEM;
	} else if (type == "particles") {
		mode = MODE_PARTICLES;
	} else if (type == "sky") {
		mode = MODE_SKY;
	} else if (type == "fog") {
		mode = MODE_FOG;
	} else {
		mode = MODE_SPATIAL;
	}
	for (const Ref<ShaderInclude> &E : include_dependencies) {
		E->connect_changed(callable_mp(this, &Shader::_dependency_changed));
	}
	RenderingServer::get_singleton()->shader_set_code(shader, pp_code);
	emit_changed();
}
String Shader::get_code() const {
	_update_shader();
	return code;
}
void Shader::get_shader_uniform_list(List<PropertyInfo> *p_params, bool p_get_groups) const {