### Godot version

9f9210e60cddb2fa82ce5f7d71fcba340f2edbd1

### System information

Windows 11

### Issue description

I found that one of particles shaders in my project begin working incorrectly after the recent fixes. I've bisected it to 9f9210e60cddb2fa82ce5f7d71fcba340f2edbd1.

Before:
![image](https://github.com/godotengine/godot/assets/3036176/556bb0ed-6214-42ce-b194-8b54b0349b18)


After:
![image](https://github.com/godotengine/godot/assets/3036176/b3fa0b8a-20a6-4c5a-aea7-3e1ec465ea3e)


### Steps to reproduce

Download the provided test project and compare changes with different version.

### Minimal reproduction project

[bug.zip](https://github.com/godotengine/godot/files/12476303/bug.zip)

protected:
	static void _bind_methods();
public:
	void set_gradient(Ref<Gradient> p_gradient);
	Ref<Gradient> get_gradient() const;
	void set_width(int p_width);
	virtual int get_width() const override;
	void set_height(int p_height);
	virtual int get_height() const override;
	void set_use_hdr(bool p_enabled);
	bool is_using_hdr() const;
	void set_fill(Fill p_fill);
	Fill get_fill() const;
	void set_fill_from(Vector2 p_fill_from);
	Vector2 get_fill_from() const;
	void set_fill_to(Vector2 p_fill_to);
	Vector2 get_fill_to() const;
	void set_repeat(Repeat p_repeat);
	Repeat get_repeat() const;
	virtual RID get_rid() const override;
	virtual bool has_alpha() const override { return true; }
	virtual Ref<Image> get_image() const override;
	void update_now();
	GradientTexture2D();
	virtual ~GradientTexture2D();
};
VARIANT_ENUM_CAST(GradientTexture2D::Fill);
VARIANT_ENUM_CAST(GradientTexture2D::Repeat);
#endif