### Godot version

 v4.0.beta11.official.91713ced8

### System information

macOS 12.6.1 Monterey, Apple M1 Pro

### Issue description

After reopening scenes with Sprite2D and trying to edit the region of the sprite again the Godot app crashed.

### Steps to reproduce

1. Open scene node_2d in the project files
2. Go to Sprite2D and click on edit region, pop up should show
3. Close the popup and close the scene with X on the tab
4. Reopen the scene, go to Sprite2D and click on Edit region
5. Godot should crash

### Minimal reproduction project

[region_crash.zip](https://github.com/godotengine/godot/files/10400566/region_crash.zip)

hb_grid->add_child(memnew(Label(TTR("Separation:"))));
	sb_sep_x = memnew(SpinBox);
	sb_sep_x->set_min(0);
	sb_sep_x->set_max(256);
	sb_sep_x->set_step(1);
	sb_sep_x->set_value(snap_separation.x);
	sb_sep_x->set_suffix("px");
	sb_sep_x->connect("value_changed", callable_mp(this, &TextureRegionEditor::_set_snap_sep_x));
	hb_grid->add_child(sb_sep_x);
	sb_sep_y = memnew(SpinBox);
	sb_sep_y->set_min(0);
	sb_sep_y->set_max(256);
	sb_sep_y->set_step(1);
	sb_sep_y->set_value(snap_separation.y);
	sb_sep_y->set_suffix("px");
	sb_sep_y->connect("value_changed", callable_mp(this, &TextureRegionEditor::_set_snap_sep_y));
	hb_grid->add_child(sb_sep_y);
	hb_grid->hide();
	panner.instantiate();
	panner->set_callbacks(callable_mp(this, &TextureRegionEditor::_scroll_callback), callable_mp(this, &TextureRegionEditor::_pan_callback), callable_mp(this, &TextureRegionEditor::_zoom_callback));
	edit_draw = memnew(Panel);
	vb->add_child(edit_draw);
	edit_draw->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	edit_draw->connect("draw", callable_mp(this, &TextureRegionEditor::_region_draw));
	edit_draw->connect("gui_input", callable_mp(this, &TextureRegionEditor::_region_input));
	edit_draw->connect("focus_exited", callable_mp(panner.ptr(), &ViewPanner::release_pan_key));
	edit_draw->set_focus_mode(Control::FOCUS_CLICK);
	draw_zoom = 1.0;
	edit_draw->set_clip_contents(true);
	HBoxContainer *zoom_hb = memnew(HBoxContainer);