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

ERR_READ_THREAD_GUARD_V(false);
	return physics_object_picking;
}
void Viewport::set_physics_object_picking_sort(bool p_enable) {
	ERR_MAIN_THREAD_GUARD;
	physics_object_picking_sort = p_enable;
}
bool Viewport::get_physics_object_picking_sort() {
	ERR_READ_THREAD_GUARD_V(false);
	return physics_object_picking_sort;
}
Vector2 Viewport::get_camera_coords(const Vector2 &p_viewport_coords) const {
	ERR_READ_THREAD_GUARD_V(Vector2());
	Transform2D xf = stretch_transform * global_canvas_transform;
	return xf.xform(p_viewport_coords);
}
Vector2 Viewport::get_camera_rect_size() const {
	ERR_READ_THREAD_GUARD_V(Vector2());
	return size;
}
void Viewport::set_disable_input(bool p_disable) {