### Godot version

4.0.3 stable

### System information

Windows 11

### Issue description

When a main screen plugin contains a viewport, the editor crashes on load.

### Steps to reproduce

(See attached repro project below)

1. Launch the project
2. In project settings, turn on the plugin
3. Close the project
4. Open the project
5. Observe that the editor crashes on load

### Minimal reproduction project

[main_screen_viewport.zip](https://github.com/godotengine/godot/files/11605004/main_screen_viewport.zip)

I uploaded a project where the plugin is turned off so you can look at the project without having to open any script editor to remove the plugin from the enabled list.
bool is_not_in_scene_or_editor = !(is_inside_tree() && Engine::get_singleton()->is_editor_hint());
	bool is_any_smoothing_valid = position_smoothing_speed > 0 || rotation_smoothing_speed > 0;
	bool enable = is_any_smoothing_valid && is_not_in_scene_or_editor;
	set_process_internal(enable);
}
void Camera2D::make_current() {
	ERR_FAIL_COND(!enabled || !is_inside_tree());
	get_tree()->call_group(group_name, "_make_current", this);
	if (just_exited_tree) {
		
		_make_current(this);
	}
	_update_scroll();
}
void Camera2D::clear_current() {
	ERR_FAIL_COND(!is_current());
	if (viewport && !(custom_viewport && !ObjectDB::get_instance(custom_viewport_id)) && viewport->is_inside_tree()) {
		viewport->assign_next_enabled_camera_2d(group_name);
	}
}
bool Camera2D::is_current() const {
	if (viewport && !(custom_viewport && !ObjectDB::get_instance(custom_viewport_id))) {
		return viewport->get_camera_2d() == this;
	}
	return false;
}
void Camera2D::set_limit(Side p_side, int p_limit) {