### Godot version

v4.0.beta14.official [28a24639c]
v4.0.1.stable.official [cacf49999]

### System information

Windows 11 22H2, Forward+, NVIDIA MX350 (528.02) and NVIDIA RTX2070 (517.00)
Ubuntu 22.04, Forward+, NVIDIA MX350 (525.85.05)

### Issue description

Instancing a GPUParticles3D can cause colored flashes on screen. In some cases (such as the minimal reproduction project), the flashes are small, however in my other project I have seen them fill the screen. I am still unsure what causes the different sizes

These are some example correct frames from the minimal reproduction project (the effect is supposed to be a fireball.)

<img width="578" alt="image" src="https://user-images.githubusercontent.com/8741983/214133602-ff0e5916-fa0b-4e52-8dac-9701b8220a1d.png">

<img width="578" alt="image" src="https://user-images.githubusercontent.com/8741983/214133646-c976fde1-569c-4d0a-9395-fd037f21e0b9.png">

These are some example incorrect frames.

<img width="578" alt="image" src="https://user-images.githubusercontent.com/8741983/214133760-8e4804e8-f194-4d31-b943-0d93ab6d60cb.png">

<img width="578" alt="image" src="https://user-images.githubusercontent.com/8741983/214132553-c6d4be93-5373-43b5-b52e-d9a33924e9bf.png">


### Steps to reproduce

Create two scenes, one with a GPUParticles3D, and one that instances those particles repeatedly, using a script. Flashes will occur on screen.

### Minimal reproduction project

[Particle Flash MRP.zip](https://github.com/godotengine/godot/files/10483071/Particle.Flash.MRP.zip)


Edit 1: Corrected driver version for my friend's computer.
Edit 2: Added note about the issue also appearing on Linux, and that the issue is still present in 4.0.1

*Bugsquad edit (keywords for easier searching): flicker, flickering*
actions.render_mode_flags["use_quarter_res_pass"] = &uses_quarter_res;
	actions.usage_flag_pointers["TIME"] = &uses_time;
*/
	actions.usage_flag_pointers["COLLIDED"] = &uses_collision;
	userdata_count = 0;
	for (uint32_t i = 0; i < ParticlesShader::MAX_USERDATAS; i++) {
		userdatas_used[i] = false;
		actions.usage_flag_pointers["USERDATA" + itos(i + 1)] = &userdatas_used[i];
	}
	actions.uniforms = &uniforms;
	Error err = particles_storage->particles_shader.compiler.compile(RS::SHADER_PARTICLES, code, &actions, path, gen_code);
	ERR_FAIL_COND_MSG(err != OK, "Shader compilation failed.");
	if (version.is_null()) {
		version = particles_storage->particles_shader.shader.version_create();
	}
	for (uint32_t i = 0; i < ParticlesShader::MAX_USERDATAS; i++) {
		if (userdatas_used[i]) {
			userdata_count++;
		}
	}
	particles_storage->particles_shader.shader.version_set_compute_code(version, gen_code.code, gen_code.uniforms, gen_code.stage_globals[ShaderCompiler::STAGE_COMPUTE], gen_code.defines);
	ERR_FAIL_COND(!particles_storage->particles_shader.shader.version_is_valid(version));
	ubo_size = gen_code.uniform_total_size;
	ubo_offsets = gen_code.uniform_offsets;
	texture_uniforms = gen_code.texture_uniforms;
	
	pipeline = RD::get_singleton()->compute_pipeline_create(particles_storage->particles_shader.shader.version_get_shader(version, 0));
	valid = true;
}
bool ParticlesStorage::ParticlesShaderData::is_animated() const {