### 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
Node *_duplicate(int p_flags, HashMap<const Node *, Node *> *r_duplimap = nullptr) const;
	TypedArray<StringName> _get_groups() const;
	Error _rpc_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
	Error _rpc_id_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
	friend class SceneTree;
	void _set_tree(SceneTree *p_tree);
	void _propagate_pause_notification(bool p_enable);
	_FORCE_INLINE_ bool _can_process(bool p_paused) const;
	_FORCE_INLINE_ bool _is_enabled() const;
	void _release_unique_name_in_owner();
	void _acquire_unique_name_in_owner();
	void _clean_up_owner();
	_FORCE_INLINE_ void _update_children_cache() const {
		if (unlikely(data.children_cache_dirty)) {
			_update_children_cache_impl();
		}
	}
	void _update_children_cache_impl() const;
	
	void _add_process_group();
	void _remove_process_group();
	void _add_to_process_thread_group();
	void _remove_from_process_thread_group();
	void _remove_tree_from_process_thread_group();
	void _add_tree_to_process_thread_group(Node *p_owner);
	static thread_local Node *current_process_thread_group;
	Variant _call_deferred_thread_group_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
	Variant _call_thread_safe_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
protected:
	void _block() { data.blocked++; }