### 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
ERR_FAIL_COND_V(!data.tree, nullptr);
		return data.tree;
	}
	_FORCE_INLINE_ bool is_inside_tree() const { return data.inside_tree; }
	bool is_ancestor_of(const Node *p_node) const;
	bool is_greater_than(const Node *p_node) const;
	NodePath get_path() const;
	NodePath get_path_to(const Node *p_node, bool p_use_unique_path = false) const;
	Node *find_common_parent_with(const Node *p_node) const;
	void add_to_group(const StringName &p_identifier, bool p_persistent = false);
	void remove_from_group(const StringName &p_identifier);
	bool is_in_group(const StringName &p_identifier) const;
	struct GroupInfo {
		StringName name;
		bool persistent = false;
	};
	void get_groups(List<GroupInfo> *p_groups) const;
	int get_persistent_group_count() const;
	void move_child(Node *p_child, int p_index);
	void _move_child(Node *p_child, int p_index, bool p_ignore_end = false);
	void set_owner(Node *p_owner);
	Node *get_owner() const;
	void get_owned_by(Node *p_by, List<Node *> *p_owned);
	void set_unique_name_in_owner(bool p_enabled);
	bool is_unique_name_in_owner() const;
	_FORCE_INLINE_ int get_index(bool p_include_internal = true) const {