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

Vector2 subwindow_drag_pos;
		Rect2i subwindow_drag_close_rect;
		bool subwindow_drag_close_inside = false;
		SubWindowResize subwindow_resize_mode;
		Rect2i subwindow_resize_from_rect;
		Vector<SubWindow> sub_windows; 
	} gui;
	DefaultCanvasItemTextureFilter default_canvas_item_texture_filter = DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR;
	DefaultCanvasItemTextureRepeat default_canvas_item_texture_repeat = DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED;
	bool disable_input = false;
	bool _gui_call_input(Control *p_control, const Ref<InputEvent> &p_input);
	void _gui_call_notification(Control *p_control, int p_what);
	void _gui_sort_roots();
	Control *_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_global, const Transform2D &p_xform);
	void _gui_input_event(Ref<InputEvent> p_event);
	void _perform_drop(Control *p_control = nullptr, Point2 p_pos = Point2());
	void _gui_cleanup_internal_state(Ref<InputEvent> p_event);
	void _push_unhandled_input_internal(const Ref<InputEvent> &p_event);
	Ref<InputEvent> _make_input_local(const Ref<InputEvent> &ev);
	friend class Control;
	List<Control *>::Element *_gui_add_root_control(Control *p_control);
	void _gui_remove_root_control(List<Control *>::Element *RI);
	String _gui_get_tooltip(Control *p_control, const Vector2 &p_pos, Control **r_tooltip_owner = nullptr);
	void _gui_cancel_tooltip();
	void _gui_show_tooltip();
	void _gui_remove_control(Control *p_control);
	void _gui_hide_control(Control *p_control);
	void _gui_force_drag(Control *p_base, const Variant &p_data, Control *p_control);
	void _gui_set_drag_preview(Control *p_base, Control *p_control);
	Control *_gui_get_drag_preview();