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

AudioListener2D *get_audio_listener_2d() const;
	Camera2D *get_camera_2d() const;
	void set_as_audio_listener_2d(bool p_enable);
	bool is_audio_listener_2d() const;
	void update_canvas_items();
	Rect2 get_visible_rect() const;
	RID get_viewport_rid() const;
	void set_world_2d(const Ref<World2D> &p_world_2d);
	Ref<World2D> get_world_2d() const;
	Ref<World2D> find_world_2d() const;
	void enable_canvas_transform_override(bool p_enable);
	bool is_canvas_transform_override_enbled() const;
	void set_canvas_transform_override(const Transform2D &p_transform);
	Transform2D get_canvas_transform_override() const;
	void set_canvas_transform(const Transform2D &p_transform);
	Transform2D get_canvas_transform() const;
	void set_global_canvas_transform(const Transform2D &p_transform);
	Transform2D get_global_canvas_transform() const;
	virtual Transform2D get_final_transform() const;
	void assign_next_enabled_camera_2d(const StringName &p_camera_group);
	void gui_set_root_order_dirty();
	void set_transparent_background(bool p_enable);
	bool has_transparent_background() const;
	Ref<ViewportTexture> get_texture() const;