### 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)

ClassDB::bind_method(D_METHOD("get_texture"), &Viewport::get_texture);
	ClassDB::bind_method(D_METHOD("set_physics_object_picking", "enable"), &Viewport::set_physics_object_picking);
	ClassDB::bind_method(D_METHOD("get_physics_object_picking"), &Viewport::get_physics_object_picking);
	ClassDB::bind_method(D_METHOD("set_physics_object_picking_sort", "enable"), &Viewport::set_physics_object_picking_sort);
	ClassDB::bind_method(D_METHOD("get_physics_object_picking_sort"), &Viewport::get_physics_object_picking_sort);
	ClassDB::bind_method(D_METHOD("get_viewport_rid"), &Viewport::get_viewport_rid);
	ClassDB::bind_method(D_METHOD("push_text_input", "text"), &Viewport::push_text_input);
	ClassDB::bind_method(D_METHOD("push_input", "event", "in_local_coords"), &Viewport::push_input, DEFVAL(false));
#ifndef DISABLE_DEPRECATED
	ClassDB::bind_method(D_METHOD("push_unhandled_input", "event", "in_local_coords"), &Viewport::push_unhandled_input, DEFVAL(false));
#endif 
	ClassDB::bind_method(D_METHOD("get_camera_2d"), &Viewport::get_camera_2d);
	ClassDB::bind_method(D_METHOD("set_as_audio_listener_2d", "enable"), &Viewport::set_as_audio_listener_2d);
	ClassDB::bind_method(D_METHOD("is_audio_listener_2d"), &Viewport::is_audio_listener_2d);
	ClassDB::bind_method(D_METHOD("get_mouse_position"), &Viewport::get_mouse_position);
	ClassDB::bind_method(D_METHOD("warp_mouse", "position"), &Viewport::warp_mouse);
	ClassDB::bind_method(D_METHOD("update_mouse_cursor_state"), &Viewport::update_mouse_cursor_state);
	ClassDB::bind_method(D_METHOD("gui_get_drag_data"), &Viewport::gui_get_drag_data);
	ClassDB::bind_method(D_METHOD("gui_is_dragging"), &Viewport::gui_is_dragging);
	ClassDB::bind_method(D_METHOD("gui_is_drag_successful"), &Viewport::gui_is_drag_successful);
	ClassDB::bind_method(D_METHOD("gui_release_focus"), &Viewport::gui_release_focus);
	ClassDB::bind_method(D_METHOD("gui_get_focus_owner"), &Viewport::gui_get_focus_owner);
	ClassDB::bind_method(D_METHOD("set_disable_input", "disable"), &Viewport::set_disable_input);
	ClassDB::bind_method(D_METHOD("is_input_disabled"), &Viewport::is_input_disabled);
	ClassDB::bind_method(D_METHOD("_gui_remove_focus_for_window"), &Viewport::_gui_remove_focus_for_window);
	ClassDB::bind_method(D_METHOD("_post_gui_grab_click_focus"), &Viewport::_post_gui_grab_click_focus);
	ClassDB::bind_method(D_METHOD("set_positional_shadow_atlas_size", "size"), &Viewport::set_positional_shadow_atlas_size);
	ClassDB::bind_method(D_METHOD("get_positional_shadow_atlas_size"), &Viewport::get_positional_shadow_atlas_size);
	ClassDB::bind_method(D_METHOD("set_positional_shadow_atlas_16_bits", "enable"), &Viewport::set_positional_shadow_atlas_16_bits);
	ClassDB::bind_method(D_METHOD("get_positional_shadow_atlas_16_bits"), &Viewport::get_positional_shadow_atlas_16_bits);