### 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
bool physics_process_internal = false;
		bool process_internal = false;
		bool input = false;
		bool shortcut_input = false;
		bool unhandled_input = false;
		bool unhandled_key_input = false;
		bool parent_owned = false;
		bool in_constructor = true;
		bool use_placeholder = false;
		bool display_folded = false;
		bool editable_instance = false;
		mutable NodePath *path_cache = nullptr;
	} data;
	Ref<MultiplayerAPI> multiplayer;
	void _print_tree_pretty(const String &prefix, const bool last);
	void _print_tree(const Node *p_node);
	Node *_get_child_by_name(const StringName &p_name) const;
	void _replace_connections_target(Node *p_new_target);
	void _validate_child_name(Node *p_child, bool p_force_human_readable = false);
	void _generate_serial_child_name(const Node *p_child, StringName &name) const;
	void _propagate_reverse_notification(int p_notification);
	void _propagate_deferred_notification(int p_notification, bool p_reverse);
	void _propagate_enter_tree();
	void _propagate_ready();
	void _propagate_exit_tree();
	void _propagate_after_exit_tree();
	void _propagate_process_owner(Node *p_owner, int p_pause_notification, int p_enabled_notification);
	void _propagate_groups_dirty();
	Array _get_node_and_resource(const NodePath &p_path);
	void _duplicate_signals(const Node *p_original, Node *p_copy) const;