### 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
switch (p_what) {
		case NOTIFICATION_PHYSICS_PROCESS: {
			EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET("gui/common/snap_controls_to_pixels"));
			int nb_having_pivot = 0;
			// Update the viewport if the canvas_item changes
			List<CanvasItem *> selection = _get_edited_canvas_items(true);
			for (CanvasItem *ci : selection) {
				CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(ci);
				Rect2 rect;
				if (ci->_edit_use_rect()) {
					rect = ci->_edit_get_rect();
				} else {
					rect = Rect2();
				}
				Transform2D xform = ci->get_transform();
				if (rect != se->prev_rect || xform != se->prev_xform) {
					viewport->queue_redraw();
					se->prev_rect = rect;
					se->prev_xform = xform;
				}
				Control *control = Object::cast_to<Control>(ci);
				if (control) {
					real_t anchors[4];
					Vector2 pivot;
					pivot = control->get_pivot_offset();
					anchors[SIDE_LEFT] = control->get_anchor(SIDE_LEFT);
					anchors[SIDE_RIGHT] = control->get_anchor(SIDE_RIGHT);
					anchors[SIDE_TOP] = control->get_anchor(SIDE_TOP);
					anchors[SIDE_BOTTOM] = control->get_anchor(SIDE_BOTTOM);