### 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
return data.name;
}
void Node::_set_name_nocheck(const StringName &p_name) {
	data.name = p_name;
}
void Node::set_name(const String &p_name) {
	ERR_FAIL_COND_MSG(data.inside_tree && !Thread::is_main_thread(), "Changing the name to nodes inside the SceneTree is only allowed from the main thread. Use `set_name.call_deferred(new_name)`.");
	String name = p_name.validate_node_name();
	ERR_FAIL_COND(name.is_empty());
	if (data.unique_name_in_owner && data.owner) {
		_release_unique_name_in_owner();
	}
	String old_name = data.name;
	data.name = name;
	if (data.parent) {
		data.parent->_validate_child_name(this, true);
		bool success = data.parent->data.children.replace_key(old_name, data.name);
		ERR_FAIL_COND_MSG(!success, "Renaming child in hashtable failed, this is a bug.");
	}
	if (data.unique_name_in_owner && data.owner) {
		_acquire_unique_name_in_owner();
	}
	propagate_notification(NOTIFICATION_PATH_RENAMED);
	if (is_inside_tree()) {
		emit_signal(SNAME("renamed"));
		get_tree()->node_renamed(this);
		get_tree()->tree_changed();
	}
}
String Node::get_description() const {