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

undo_redo->add_do_property(child, "texture_normal", texture);
	} else {
		undo_redo->add_do_property(child, "texture", texture);
	}
	// make visible for certain node type
	if (Object::cast_to<Control>(child)) {
		Size2 texture_size = texture->get_size();
		undo_redo->add_do_property(child, "size", texture_size);
	} else if (Object::cast_to<Polygon2D>(child)) {
		Size2 texture_size = texture->get_size();
		Vector<Vector2> list = {
			Vector2(0, 0),
			Vector2(texture_size.width, 0),
			Vector2(texture_size.width, texture_size.height),
			Vector2(0, texture_size.height)
		};
		undo_redo->add_do_property(child, "polygon", list);
	}
	// Compute the global position
	Transform2D xform = canvas_item_editor->get_canvas_transform();
	Point2 target_position = xform.affine_inverse().xform(p_point);
	// Adjust position for Control and TouchScreenButton
	if (Object::cast_to<Control>(child) || Object::cast_to<TouchScreenButton>(child)) {
		target_position -= texture->get_size() / 2;
	}
	// there's nothing to be used as source position so snapping will work as absolute if enabled
	target_position = canvas_item_editor->snap_point(target_position);
	undo_redo->add_do_method(child, "set_global_position", target_position);
}
bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) {