### Godot version

4.1 dev2, 4.0.3

### System information

Windows 10, ryzen 5900x, radeon 6950xt (driver: 23.2.2)

### Issue description

There are two bugs:
- When I create a new node, it is created outside of the viewport. (as in first video)
- When I run the project, all the content inside the viewport dont appear. (as in second video)
I believe the second issue is related to the first.

Note: these problems are in RTL editors.

https://github.com/godotengine/godot/assets/121864036/84f0d434-0d1b-4c23-9fb0-510257e2e191


https://github.com/godotengine/godot/assets/121864036/b2bc20c7-1e2e-4d04-99e7-d66860ffced2




### Steps to reproduce

Videos explain.

### Minimal reproduction project

N/A
ERR_FAIL_COND((p_state.size() <= 0) ||
			!p_state.has("rotation") || !p_state.has("scale") ||
			!p_state.has("pivot") || !p_state.has("anchors") || !p_state.has("offsets") ||
			!p_state.has("layout_mode") || !p_state.has("anchors_layout_preset"));
	Dictionary state = p_state;
	set_rotation(state["rotation"]);
	set_scale(state["scale"]);
	set_pivot_offset(state["pivot"]);
	Array anchors = state["anchors"];
	
	LayoutMode _layout = (LayoutMode)(int)state["layout_mode"];
	if (_layout == LayoutMode::LAYOUT_MODE_POSITION) {
		bool anchors_mode = ((real_t)anchors[0] != 0.0 || (real_t)anchors[1] != 0.0 || (real_t)anchors[2] != 0.0 || (real_t)anchors[3] != 0.0);
		if (anchors_mode) {
			_layout = LayoutMode::LAYOUT_MODE_ANCHORS;
		}
	}
	_set_layout_mode(_layout);
	if (_layout == LayoutMode::LAYOUT_MODE_ANCHORS || _layout == LayoutMode::LAYOUT_MODE_UNCONTROLLED) {
		_set_anchors_layout_preset((int)state["anchors_layout_preset"]);
	}
	data.anchor[SIDE_LEFT] = anchors[0];
	data.anchor[SIDE_TOP] = anchors[1];
	data.anchor[SIDE_RIGHT] = anchors[2];
	data.anchor[SIDE_BOTTOM] = anchors[3];
	Array offsets = state["offsets"];
	data.offset[SIDE_LEFT] = offsets[0];
	data.offset[SIDE_TOP] = offsets[1];
	data.offset[SIDE_RIGHT] = offsets[2];
	data.offset[SIDE_BOTTOM] = offsets[3];