### Godot version

v4.0.beta.custom_build [291add339]

### System information

Windows 10, Forward+, NVIDIA GeForce GTX 1050 Ti (31.0.15.1694)

### Issue description

I was testing if #69669 was solved by #70418, which it seemed to be. However, I got a wall of errors at the same time.

In the minimal reproduction project below in this Issue, I get errors when instantiating many of the same `GPUParticle2D` scene. In my earlier Godot 4 build (v4.0.beta.custom_build [2a04b18d3]) I did not get any errors (but got the occasional artifact as was my original issue in #69669).

I suspect the PR #70418 solved the artifact, but possibly introduced new bugs. However, I have not specifically built Godot with, and without the PR in question.

I believe this is the start and end of the errors - after which they repeat.
![wall_of_errors](https://user-images.githubusercontent.com/10490534/209046500-9813150c-d6e4-4a11-8e62-79d370d07009.png)

### Steps to reproduce

- Create a GPUParticle2D scene
- Instantiate the scene several times
- Observe the debugger get flooded with errors

### Minimal reproduction project

This project only instantiates default GPUParticle2D scenes with a default particle material.
[GPU_Particle_Creation_Bug.zip](https://github.com/godotengine/godot/files/10283416/GPU_Particle_Creation_Bug.zip)

shader_version = SceneShaderForwardMobile::SHADER_VERSION_SHADOW_PASS_DP;
			} break;
			case PASS_MODE_DEPTH_MATERIAL: {
				ERR_FAIL_COND_MSG(p_params->view_count > 1, "Multiview not supported for material pass");
				shader_version = SceneShaderForwardMobile::SHADER_VERSION_DEPTH_PASS_WITH_MATERIAL;
			} break;
		}
		PipelineCacheRD *pipeline = nullptr;
		pipeline = &shader->pipelines[cull_variant][primitive][shader_version];
		RD::VertexFormatID vertex_format = -1;
		RID vertex_array_rd;
		RID index_array_rd;
		
		if (surf->owner->mesh_instance.is_valid()) {
			mesh_storage->mesh_instance_surface_get_vertex_arrays_and_format(surf->owner->mesh_instance, surf->surface_index, pipeline->get_vertex_input_mask(), vertex_array_rd, vertex_format);
		} else {
			mesh_storage->mesh_surface_get_vertex_arrays_and_format(mesh_surface, pipeline->get_vertex_input_mask(), vertex_array_rd, vertex_format);
		}
		index_array_rd = mesh_storage->mesh_surface_get_index_array(mesh_surface, element_info.lod_index);
		if (prev_vertex_array_rd != vertex_array_rd) {
			RD::get_singleton()->draw_list_bind_vertex_array(draw_list, vertex_array_rd);
			prev_vertex_array_rd = vertex_array_rd;
		}
		if (prev_index_array_rd != index_array_rd) {
			if (index_array_rd.is_valid()) {
				RD::get_singleton()->draw_list_bind_index_array(draw_list, index_array_rd);
			}
			prev_index_array_rd = index_array_rd;
		}
		RID pipeline_rd = pipeline->get_render_pipeline(vertex_format, framebuffer_format, p_params->force_wireframe, p_params->subpass, base_spec_constants);