### 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
void set_import_path(const NodePath &p_import_path); 
	NodePath get_import_path() const;
	bool is_owned_by_parent() const;
	void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
	void clear_internal_tree_resource_paths();
	_FORCE_INLINE_ Viewport *get_viewport() const { return data.viewport; }
	virtual PackedStringArray get_configuration_warnings() const;
	String get_configuration_warnings_as_string() const;
	void update_configuration_warnings();
	void set_display_folded(bool p_folded);
	bool is_displayed_folded() const;
	
	virtual void set_multiplayer_authority(int p_peer_id, bool p_recursive = true);
	int get_multiplayer_authority() const;
	bool is_multiplayer_authority() const;
	void rpc_config(const StringName &p_method, const Variant &p_config); 
	const Variant get_node_rpc_config() const;
	template <typename... VarArgs>
	Error rpc(const StringName &p_method, VarArgs... p_args);
	template <typename... VarArgs>
	Error rpc_id(int p_peer_id, const StringName &p_method, VarArgs... p_args);
	Error rpcp(int p_peer_id, const StringName &p_method, const Variant **p_arg, int p_argcount);
	Ref<MultiplayerAPI> get_multiplayer() const;
	void call_deferred_thread_groupp(const StringName &p_method, const Variant **p_args, int p_argcount, bool p_show_error = false);
	template <typename... VarArgs>
	void call_deferred_thread_group(const StringName &p_method, VarArgs... p_args) {