### Godot version

4.2 eca6f0e

### System information

Windows 10 x64

### Issue description


https://github.com/godotengine/godot/assets/2223172/a2796263-4e2e-4b14-a080-b3ad034cc141



### Steps to reproduce

1. Add SubViewport
2. Add Sprite2D
3. Set spirte's texture to ViewportTexture
4. Create new scene
5. Instance the new scene inside the scene with viewport
6. Make sure both scenes are opened
7. Go to instance scene and save it
8. Go to viewport scene

You will see error spam. Reloading the scene fixes it.

### Minimal reproduction project

[vip.zip](https://github.com/godotengine/godot/files/12292386/vip.zip)

SubWindowResize subwindow_resize_mode;
		Rect2i subwindow_resize_from_rect;
		Vector<SubWindow> sub_windows; 
	} gui;
	DefaultCanvasItemTextureFilter default_canvas_item_texture_filter = DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR;
	DefaultCanvasItemTextureRepeat default_canvas_item_texture_repeat = DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED;
	bool disable_input = false;
	bool _gui_call_input(Control *p_control, const Ref<InputEvent> &p_input);
	void _gui_call_notification(Control *p_control, int p_what);
	void _gui_sort_roots();
	Control *_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_global, const Transform2D &p_xform);
	void _gui_input_event(Ref<InputEvent> p_event);
	void _perform_drop(Control *p_control = nullptr, Point2 p_pos = Point2());
	void _gui_cleanup_internal_state(Ref<InputEvent> p_event);
	void _push_unhandled_input_internal(const Ref<InputEvent> &p_event);
	Ref<InputEvent> _make_input_local(const Ref<InputEvent> &ev);
	friend class Control;
	List<Control *>::Element *_gui_add_root_control(Control *p_control);
	void _gui_remove_root_control(List<Control *>::Element *RI);
	String _gui_get_tooltip(Control *p_control, const Vector2 &p_pos, Control **r_tooltip_owner = nullptr);
	void _gui_cancel_tooltip();
	void _gui_show_tooltip();
	void _gui_remove_control(Control *p_control);
	void _gui_hide_control(Control *p_control);
	void _gui_force_drag(Control *p_base, const Variant &p_data, Control *p_control);
	void _gui_set_drag_preview(Control *p_base, Control *p_control);
	Control *_gui_get_drag_preview();
	void _gui_remove_focus_for_window(Node *p_window);
	void _gui_unfocus_control(Control *p_control);
	bool _gui_control_has_focus(const Control *p_control);