### 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_MAIN_THREAD_GUARD;
	_internal_set_size(p_size);
}
void SubViewport::set_size_force(const Size2i &p_size) {
	ERR_MAIN_THREAD_GUARD;
	// Use only for setting the size from the parent SubViewportContainer with enabled stretch mode.
	// Don't expose function to scripting.
	_internal_set_size(p_size, true);
}
void SubViewport::_internal_set_size(const Size2i &p_size, bool p_force) {
	SubViewportContainer *c = Object::cast_to<SubViewportContainer>(get_parent());
	if (!p_force && c && c->is_stretch_enabled()) {
#ifdef DEBUG_ENABLED
		WARN_PRINT("Can't change the size of a `SubViewport` with a `SubViewportContainer` parent that has `stretch` enabled. Set `SubViewportContainer.stretch` to `false` to allow changing the size manually.");
#endif // DEBUG_ENABLED
		return;
	}
	_set_size(p_size, _get_size_2d_override(), true);
	if (c) {
		c->update_minimum_size();
	}
}
Size2i SubViewport::get_size() const {