### 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(!is_inside_tree());
	SceneTree::ProcessGroup *pg = (SceneTree::ProcessGroup *)data.process_group;
	pg->call_queue.push_notification(this, p_notification);
}
void Node::call_thread_safep(const StringName &p_method, const Variant **p_args, int p_argcount, bool p_show_error) {
	if (is_accessible_from_caller_thread()) {
		Callable::CallError ce;
		callp(p_method, p_args, p_argcount, ce);
		if (p_show_error && ce.error != Callable::CallError::CALL_OK) {
			ERR_FAIL_MSG("Error calling method from 'call_threadp': " + Variant::get_call_error_text(this, p_method, p_args, p_argcount, ce) + ".");
		}
	} else {
		call_deferred_thread_groupp(p_method, p_args, p_argcount, p_show_error);
	}
}
void Node::set_thread_safe(const StringName &p_property, const Variant &p_value) {
	if (is_accessible_from_caller_thread()) {
		set(p_property, p_value);
	} else {
		set_deferred_thread_group(p_property, p_value);
	}
}
void Node::notify_thread_safe(int p_notification) {
	if (is_accessible_from_caller_thread()) {
		notification(p_notification);
	} else {
		notify_deferred_thread_group(p_notification);
	}
}
void Node::_bind_methods() {