### Godot version

v4.0.3.stable.official [5222a99f5]

### System information

Debian 11 | Vulkan API 1.2.175 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1080 | nvidia-driver 470.182.03-1 from Debian 11 | Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz

### Issue description

Re-opening a scene in the editor that contains a `TextureRect` with a `ViewportTexture` and is `preload`ed in an unopened script produces the following error repeatedly and rapidly (about 200 times per second) until either the scene is closed or the script is also opened.

>ERROR: Texture (binding: 0) should provide one ID referencing a texture (IDs provided: 0).
>   at: uniform_set_create (drivers/vulkan/rendering_device_vulkan.cpp:5501)
>ERROR: Condition "!uniform_set" is true.
>   at: draw_list_bind_uniform_set (drivers/vulkan/rendering_device_vulkan.cpp:7191)
>ERROR: Uniforms were never supplied for set (3) at the time of drawing, which are required by the pipeline
>   at: draw_list_draw (drivers/vulkan/rendering_device_vulkan.cpp:7346)

### Steps to reproduce

1. Open the attached reproduction project
2. Open demo.tscn
3. Close demo.tscn
4. Open demo.tscn again

Do **not** open other.gd beforehand. Doing so will stop the problem from occurring.

### Minimal reproduction project

[reproduce_uniform_not_set.zip](https://github.com/godotengine/godot/files/11681977/reproduce_uniform_not_set.zip)

bool gui_is_dragging() const;
	bool gui_is_drag_successful() const;
	Control *gui_find_control(const Point2 &p_global);
	void set_sdf_oversize(SDFOversize p_sdf_oversize);
	SDFOversize get_sdf_oversize() const;
	void set_sdf_scale(SDFScale p_sdf_scale);
	SDFScale get_sdf_scale() const;
	void set_default_canvas_item_texture_filter(DefaultCanvasItemTextureFilter p_filter);
	DefaultCanvasItemTextureFilter get_default_canvas_item_texture_filter() const;
	void set_default_canvas_item_texture_repeat(DefaultCanvasItemTextureRepeat p_repeat);
	DefaultCanvasItemTextureRepeat get_default_canvas_item_texture_repeat() const;
	
	void set_vrs_mode(VRSMode p_vrs_mode);
	VRSMode get_vrs_mode() const;
	void set_vrs_texture(Ref<Texture2D> p_texture);
	Ref<Texture2D> get_vrs_texture() const;
	virtual DisplayServer::WindowID get_window_id() const = 0;
	void set_embedding_subwindows(bool p_embed);
	bool is_embedding_subwindows() const;
	TypedArray<Window> get_embedded_subwindows() const;
	void subwindow_set_popup_safe_rect(Window *p_window, const Rect2i &p_rect);
	Rect2i subwindow_get_popup_safe_rect(Window *p_window) const;
	Viewport *get_parent_viewport() const;
	Window *get_base_window() const;
	void pass_mouse_focus_to(Viewport *p_viewport, Control *p_control);
	void set_canvas_cull_mask(uint32_t p_layers);
	uint32_t get_canvas_cull_mask() const;
	void set_canvas_cull_mask_bit(uint32_t p_layer, bool p_enable);
	bool get_canvas_cull_mask_bit(uint32_t p_layer) const;
	virtual bool is_size_2d_override_stretch_enabled() const { return true; }