### 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

/
#ifndef TAB_CONTAINER_H
#define TAB_CONTAINER_H
#include "scene/gui/container.h"
#include "scene/gui/popup.h"
#include "scene/gui/tab_bar.h"
class TabContainer : public Container {
	GDCLASS(TabContainer, Container);
	TabBar *tab_bar = nullptr;
	bool tabs_visible = true;
	bool all_tabs_in_front = false;
	bool menu_hovered = false;
	mutable ObjectID popup_obj_id;
	bool drag_to_rearrange_enabled = false;
	bool use_hidden_tabs_for_min_size = false;
	bool theme_changing = false;
	Vector<Control *> children_removing;
	struct ThemeCache {
		int side_margin = 0;
		Ref<StyleBox> panel_style;
		Ref<StyleBox> tabbar_style;