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

Transform2D get_screen_transform() const;
	virtual Transform2D get_screen_transform_internal(bool p_absolute_position = false) const;
	virtual Transform2D get_popup_base_transform() const { return Transform2D(); }
	virtual bool is_directly_attached_to_screen() const { return false; };
	virtual bool is_attached_in_viewport() const { return false; };
	virtual bool is_sub_viewport() const { return false; };
#ifndef _3D_DISABLED
	bool use_xr = false;
	friend class AudioListener3D;
	AudioListener3D *audio_listener_3d = nullptr;
	HashSet<AudioListener3D *> audio_listener_3d_set;
	bool is_audio_listener_3d_enabled = false;
	RID internal_audio_listener_3d;
	AudioListener3D *get_audio_listener_3d() const;
	void set_as_audio_listener_3d(bool p_enable);
	bool is_audio_listener_3d() const;
	void _update_audio_listener_3d();
	void _listener_transform_3d_changed_notify();
	void _audio_listener_3d_set(AudioListener3D *p_listener);
	bool _audio_listener_3d_add(AudioListener3D *p_listener); 
	void _audio_listener_3d_remove(AudioListener3D *p_listener);
	void _audio_listener_3d_make_next_current(AudioListener3D *p_exclude);
	void _collision_object_3d_input_event(CollisionObject3D *p_object, Camera3D *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape);
	struct Camera3DOverrideData {
		Transform3D transform;
		enum Projection {