### 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
if (c) {
			if (c->data.RI) {
				break;
			}
		}
		base = base->get_parent();
	}
	if (!base) {
		return nullptr;
	}
	_window_find_focus_neighbor(vdir, base, points, maxd, dist, &result);
	return result;
}
void Control::_window_find_focus_neighbor(const Vector2 &p_dir, Node *p_at, const Point2 *p_points, real_t p_min, real_t &r_closest_dist, Control **r_closest) {
	if (Object::cast_to<Viewport>(p_at)) {
		return; 
	}
	Control *c = Object::cast_to<Control>(p_at);
	if (c && c != this && c->get_focus_mode() == FOCUS_ALL && c->is_visible_in_tree()) {
		Point2 points[4];
		Transform2D xform = c->get_global_transform();
		points[0] = xform.xform(Point2());
		points[1] = xform.xform(Point2(c->get_size().x, 0));
		points[2] = xform.xform(c->get_size());
		points[3] = xform.xform(Point2(0, c->get_size().y));
		real_t min = 1e7;
		for (int i = 0; i < 4; i++) {
			real_t d = p_dir.dot(points[i]);
			if (d < min) {
				min = d;