### Godot version

4.2 dev3

### System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

### Issue description

Basically variation of #33995

### Steps to reproduce

1. Open 2D scene
2. Drag a guide
3. Undo
4. Save

### Minimal reproduction project

N/A
if (selection_results_menu.size() <= p_result) {
		return;
	}
	CanvasItem *item = selection_results_menu[p_result].item;
	if (item) {
		_select_click_on_item(item, Point2(), selection_menu_additive_selection);
	}
	selection_results_menu.clear();
}
void CanvasItemEditor::_selection_menu_hide() {
	selection_results.clear();
	selection_menu->clear();
	selection_menu->reset_size();
}
void CanvasItemEditor::_add_node_pressed(int p_result) {
	List<Node *> nodes_to_move;
	switch (p_result) {
		case ADD_NODE: {
			SceneTreeDock::get_singleton()->open_add_child_dialog();
		} break;
		case ADD_INSTANCE: {
			SceneTreeDock::get_singleton()->open_instance_child_dialog();
		} break;
		case ADD_PASTE: {
			nodes_to_move = SceneTreeDock::get_singleton()->paste_nodes();
			[[fallthrough]];
		}
		case ADD_MOVE: {
			nodes_to_move = EditorNode::get_singleton()->get_editor_selection()->get_selected_node_list();