### Godot version

4.0.2

### System information

Windows 11

### Issue description

Changing node type from PopupMenu to ItemList causes Godot to crash

### Steps to reproduce

Change node type from PopupMenu to ItemList

### Minimal reproduction project

n/a
theme_cache.h_separation = get_theme_constant(SNAME("h_separation"));
	theme_cache.indent = get_theme_constant(SNAME("indent"));
	theme_cache.item_start_padding = get_theme_constant(SNAME("item_start_padding"));
	theme_cache.item_end_padding = get_theme_constant(SNAME("item_end_padding"));
	theme_cache.icon_max_width = get_theme_constant(SNAME("icon_max_width"));
	theme_cache.checked = get_theme_icon(SNAME("checked"));
	theme_cache.checked_disabled = get_theme_icon(SNAME("checked_disabled"));
	theme_cache.unchecked = get_theme_icon(SNAME("unchecked"));
	theme_cache.unchecked_disabled = get_theme_icon(SNAME("unchecked_disabled"));
	theme_cache.radio_checked = get_theme_icon(SNAME("radio_checked"));
	theme_cache.radio_checked_disabled = get_theme_icon(SNAME("radio_checked_disabled"));
	theme_cache.radio_unchecked = get_theme_icon(SNAME("radio_unchecked"));
	theme_cache.radio_unchecked_disabled = get_theme_icon(SNAME("radio_unchecked_disabled"));
	theme_cache.submenu = get_theme_icon(SNAME("submenu"));
	theme_cache.submenu_mirrored = get_theme_icon(SNAME("submenu_mirrored"));
	theme_cache.font = get_theme_font(SNAME("font"));
	theme_cache.font_size = get_theme_font_size(SNAME("font_size"));
	theme_cache.font_separator = get_theme_font(SNAME("font_separator"));
	theme_cache.font_separator_size = get_theme_font_size(SNAME("font_separator_size"));
	theme_cache.font_color = get_theme_color(SNAME("font_color"));
	theme_cache.font_hover_color = get_theme_color(SNAME("font_hover_color"));
	theme_cache.font_disabled_color = get_theme_color(SNAME("font_disabled_color"));
	theme_cache.font_accelerator_color = get_theme_color(SNAME("font_accelerator_color"));
	theme_cache.font_outline_size = get_theme_constant(SNAME("outline_size"));
	theme_cache.font_outline_color = get_theme_color(SNAME("font_outline_color"));
	theme_cache.font_separator_color = get_theme_color(SNAME("font_separator_color"));
	theme_cache.font_separator_outline_size = get_theme_constant(SNAME("separator_outline_size"));
	theme_cache.font_separator_outline_color = get_theme_color(SNAME("font_separator_outline_color"));
}
void PopupMenu::_notification(int p_what) {