### 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(0);
	return mesh_lod_threshold;
}
void Viewport::set_use_occlusion_culling(bool p_use_occlusion_culling) {
	ERR_MAIN_THREAD_GUARD;
	if (use_occlusion_culling == p_use_occlusion_culling) {
		return;
	}
	use_occlusion_culling = p_use_occlusion_culling;
	RS::get_singleton()->viewport_set_use_occlusion_culling(viewport, p_use_occlusion_culling);
	notify_property_list_changed();
}
bool Viewport::is_using_occlusion_culling() const {
	ERR_READ_THREAD_GUARD_V(false);
	return use_occlusion_culling;
}
void Viewport::set_debug_draw(DebugDraw p_debug_draw) {
	ERR_MAIN_THREAD_GUARD;
	debug_draw = p_debug_draw;
	RS::get_singleton()->viewport_set_debug_draw(viewport, RS::ViewportDebugDraw(p_debug_draw));
}
Viewport::DebugDraw Viewport::get_debug_draw() const {
	ERR_READ_THREAD_GUARD_V(DEBUG_DRAW_DISABLED);
	return debug_draw;
}
int Viewport::get_render_info(RenderInfoType p_type, RenderInfo p_info) {