### Godot version

v4.2.dev3.official [013e8e3af]

### System information

Windows 10, 64bit

### Issue description

![image](https://github.com/godotengine/godot/assets/35988767/ccdac68c-a60d-491b-a406-d6e3bc1c95ae)
![GIF](https://github.com/godotengine/godot/assets/35988767/7d230faf-0260-4bc3-92e8-11cd026931a8)


### Steps to reproduce

/

### Minimal reproduction project

/
Vector<Control *> controls = _get_tab_controls();
	for (int i = 0; i < controls.size(); i++) {
		if (!controls[i]->has_meta("_tab_name") && String(controls[i]->get_name()) != get_tab_title(i)) {
			tab_bar->set_tab_title(i, controls[i]->get_name());
		}
	}
}
void TabContainer::add_child_notify(Node *p_child) {
	Container::add_child_notify(p_child);
	if (p_child == tab_bar) {
		return;
	}
	Control *c = Object::cast_to<Control>(p_child);
	if (!c || c->is_set_as_top_level()) {
		return;
	}
	c->hide();
	tab_bar->add_tab(p_child->get_name());
	_update_margins();
	if (get_tab_count() == 1) {
		queue_redraw();
	}
	p_child->connect("renamed", callable_mp(this, &TabContainer::_refresh_tab_names));
	
	if (!is_inside_tree()) {
		call_deferred("_repaint");
	}
}
void TabContainer::move_child_notify(Node *p_child) {