### 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
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
	group_button->set_shortcut(ED_SHORTCUT("editor/group_selected_nodes", TTR("Group Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::G));
	ungroup_button = memnew(Button);
	ungroup_button->set_flat(true);
	main_menu_hbox->add_child(ungroup_button);
	ungroup_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNGROUP_SELECTED));
	ungroup_button->set_tooltip_text(TTR("Make selected node's children selectable."));
	// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
	ungroup_button->set_shortcut(ED_SHORTCUT("editor/ungroup_selected_nodes", TTR("Ungroup Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::G));
	main_menu_hbox->add_child(memnew(VSeparator));
	skeleton_menu = memnew(MenuButton);
	skeleton_menu->set_shortcut_context(this);
	main_menu_hbox->add_child(skeleton_menu);
	skeleton_menu->set_tooltip_text(TTR("Skeleton Options"));
	skeleton_menu->set_switch_on_hover(true);
	p = skeleton_menu->get_popup();
	p->set_hide_on_checkable_item_selection(false);
	p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_show_bones", TTR("Show Bones")), SKELETON_SHOW_BONES);
	p->add_separator();
	p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_make_bones", TTR("Make Bone2D Node(s) from Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::B), SKELETON_MAKE_BONES);
	p->connect("id_pressed", callable_mp(this, &CanvasItemEditor::_popup_callback));
	main_menu_hbox->add_child(memnew(VSeparator));
	override_camera_button = memnew(Button);
	override_camera_button->set_flat(true);
	main_menu_hbox->add_child(override_camera_button);
	override_camera_button->connect("toggled", callable_mp(this, &CanvasItemEditor::_button_override_camera));
	override_camera_button->set_toggle_mode(true);
	override_camera_button->set_disabled(true);
	_update_override_camera_button(false);
	main_menu_hbox->add_child(memnew(VSeparator));