### Godot version

4.1.dev 2e273f0e35800f2bcc7c05db54100caa97928f69

### System information

macOS 13.4

### Issue description

Removing a SpinBox from the node tree using `remove_child` during the line edit text submit signal will crash the engine.

```
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.1.dev.custom_build (2e273f0e35800f2bcc7c05db54100caa97928f69)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] 1   libsystem_platform.dylib            0x0000000183b5aa24 _sigtramp + 56
[2] Viewport::gui_get_focus_owner() (in godot.macos.editor.arm64) + 32
[3] SpinBox::_line_edit_focus_exit() (in godot.macos.editor.arm64) + 28
[4] CallQueue::_call_function(Callable const&, Variant const*, int, bool) (in godot.macos.editor.arm64) + 336
[5] CallQueue::flush() (in godot.macos.editor.arm64) + 908
[6] SceneTree::physics_process(double) (in godot.macos.editor.arm64) + 244
[7] Main::iteration() (in godot.macos.editor.arm64) + 528
```

### Steps to reproduce

Open the minimal reproduction project, click on the SpinBox, press enter, and the engine crashes.

### Minimal reproduction project

[SpinBoxTextSubmitCrash.zip](https://github.com/godotengine/godot/files/11631081/SpinBoxTextSubmitCrash.zip)

int index = _sub_window_find(p_window);
	ERR_FAIL_COND(index == -1);
	const SubWindow &sw = gui.sub_windows[index];
	Transform2D pos;
	pos.set_origin(p_window->get_position());
	RS::get_singleton()->canvas_item_clear(sw.canvas_item);
	Rect2i r = Rect2i(p_window->get_position(), sw.window->get_size());
	if (!p_window->get_flag(Window::FLAG_BORDERLESS)) {
		Ref<StyleBox> panel = p_window->get_theme_stylebox(SNAME("embedded_border"));
		panel->draw(sw.canvas_item, r);
		
		Ref<Font> title_font = p_window->get_theme_font(SNAME("title_font"));
		int font_size = p_window->get_theme_font_size(SNAME("title_font_size"));
		Color title_color = p_window->get_theme_color(SNAME("title_color"));
		int title_height = p_window->get_theme_constant(SNAME("title_height"));
		int close_h_ofs = p_window->get_theme_constant(SNAME("close_h_offset"));
		int close_v_ofs = p_window->get_theme_constant(SNAME("close_v_offset"));
		TextLine title_text = TextLine(p_window->atr(p_window->get_title()), title_font, font_size);
		title_text.set_width(r.size.width - panel->get_minimum_size().x - close_h_ofs);
		title_text.set_direction(p_window->is_layout_rtl() ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR);
		int x = (r.size.width - title_text.get_size().x) / 2;
		int y = (-title_height - title_text.get_size().y) / 2;
		Color font_outline_color = p_window->get_theme_color(SNAME("title_outline_modulate"));
		int outline_size = p_window->get_theme_constant(SNAME("title_outline_size"));
		if (outline_size > 0 && font_outline_color.a > 0) {
			title_text.draw_outline(sw.canvas_item, r.position + Point2(x, y), outline_size, font_outline_color);
		}