### Godot version

4.0.2

### System information

Windows 10,Radeon RX 550/550 Series,23.3.2,Vulkan

### Issue description

After Switching to the animations tabs and pressing the key symbol because I wanted to know what it does, Godot crashes

### Steps to reproduce

Go into a project 
Switch to the Animations Tab, make sure no animation is active 
And then press on the key symbol

here is a video demonstrating the bug

https://user-images.githubusercontent.com/59411880/233839816-5489899e-828f-4ac9-9de3-7914f727f754.mp4



### Minimal reproduction project

The File
[package.zip](https://github.com/godotengine/godot/files/11303712/package.zip)

if (drag_selection.size() > 0) {
					drag_type = DRAG_ROTATE;
					drag_from = transform.affine_inverse().xform(b->get_position());
					CanvasItem *ci = drag_selection[0];
					if (ci->_edit_use_pivot()) {
						drag_rotation_center = ci->get_global_transform_with_canvas().xform(ci->_edit_get_pivot());
					} else {
						drag_rotation_center = ci->get_global_transform_with_canvas().get_origin();
					}
					_save_canvas_item_state(drag_selection);
					return true;
				}
			}
		}
	}
	if (drag_type == DRAG_ROTATE) {
		
		if (m.is_valid()) {
			_restore_canvas_item_state(drag_selection);
			for (CanvasItem *ci : drag_selection) {
				drag_to = transform.affine_inverse().xform(m->get_position());
				
				bool opposite = (ci->get_global_transform().get_scale().sign().dot(ci->get_transform().get_scale().sign()) == 0);
				ci->_edit_set_rotation(snap_angle(ci->_edit_get_rotation() + (opposite ? -1 : 1) * (drag_from - drag_rotation_center).angle_to(drag_to - drag_rotation_center), ci->_edit_get_rotation()));
				viewport->queue_redraw();
			}
			return true;
		}
		
		if (b.is_valid() && b->get_button_index() == MouseButton::LEFT && !b->is_pressed()) {