### Godot version

Godot Engine v4.0.beta9.mono.official.e780dc332

### System information

Vulkan API 1.3.205 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 3070 Ti Laptop GPU

### Issue description

When using a sampler2d[] in a shader, the game window will not close and the task must be killed/forced closed.  Debugging shows that the code is frozen on this method: godotsharp_internal_refcounted_disposed;




### Steps to reproduce

In the attached project, there is a shader "foliageShader.gdshader" that contains a sampler2d[].  If you run the project as is and then just click X to close the window, you should see the described behavior.  Changing the shader to a single sampler2d should cause the issue to go away.

### Minimal reproduction project

[Repro (2).zip](https://github.com/godotengine/godot/files/10298745/Repro.2.zip)

String group = uniform.group;
		if (!uniform.subgroup.is_empty()) {
			group += "::" + uniform.subgroup;
		}
		if (group != last_group) {
			PropertyInfo pi;
			pi.usage = PROPERTY_USAGE_GROUP;
			pi.name = group;
			p_param_list->push_back(pi);
			last_group = group;
		}
		PropertyInfo pi = ShaderLanguage::uniform_to_property_info(uniform);
		pi.name = uniform_name;
		p_param_list->push_back(pi);
	}
}
void MaterialStorage::ShaderData::get_instance_param_list(List<RendererMaterialStorage::InstanceShaderParam> *p_param_list) const {
	for (const KeyValue<StringName, ShaderLanguage::ShaderNode::Uniform> &E : uniforms) {
		if (E.value.scope != ShaderLanguage::ShaderNode::Uniform::SCOPE_INSTANCE) {
			continue;
		}
		RendererMaterialStorage::InstanceShaderParam p;
		p.info = ShaderLanguage::uniform_to_property_info(E.value);
		p.info.name = E.key; 
		p.index = E.value.instance_index;
		p.default_value = ShaderLanguage::constant_value_to_variant(E.value.default_value, E.value.type, E.value.array_size, E.value.hint);
		p_param_list->push_back(p);
	}
}
bool MaterialStorage::ShaderData::is_parameter_texture(const StringName &p_param) const {