### Godot version

v4.1.rc1.official [1f9e540f1]

### System information

Windows 10

### Issue description

Attempting to reorder the children of a TabContainer results in an unintended ordering and incorrect undo states.

Also happens in v4.0.3.stable.official [5222a99f5].

https://github.com/godotengine/godot/assets/3820082/2c2458e3-88ad-46d9-8a04-f289a049984a



### Steps to reproduce

1. Add a new TabContainer
2. Add a few children to it
3. Drag and drop to erroneously reorder them
4. Attempt to undo the change

### Minimal reproduction project

N/A
if (res->is_built_in() && !r_remap.has(res)) {
					_create_remap_for_resource(res, r_remap);
				}
			}
		}
	}
	for (int i = 0; i < p_node->get_child_count(); i++) {
		_create_remap_for_node(p_node->get_child(i), r_remap);
	}
}
void SceneTreeDock::_create_remap_for_resource(Ref<Resource> p_resource, HashMap<Ref<Resource>, Ref<Resource>> &r_remap) {
	r_remap[p_resource] = p_resource->duplicate();
	List<PropertyInfo> props;
	p_resource->get_property_list(&props);
	for (const PropertyInfo &E : props) {
		if (!(E.usage & PROPERTY_USAGE_STORAGE)) {
			continue;
		}
		Variant v = p_resource->get(E.name);
		if (v.is_ref_counted()) {
			Ref<Resource> res = v;
			if (res.is_valid()) {
				if (res->is_built_in() && !r_remap.has(res)) {
					_create_remap_for_resource(res, r_remap);
				}
			}
		}
	}
}
void SceneTreeDock::_list_all_subresources(PopupMenu *p_menu) {