### 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
original_transform = Transform2D();
	bool transform_stored = false;
	for (CanvasItem *ci : p_canvas_items) {
		CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(ci);
		if (se) {
			if (!transform_stored) {
				original_transform = ci->get_global_transform();
				transform_stored = true;
			}
			se->undo_state = ci->_edit_get_state();
			se->pre_drag_xform = ci->get_global_transform_with_canvas();
			if (ci->_edit_use_rect()) {
				se->pre_drag_rect = ci->_edit_get_rect();
			} else {
				se->pre_drag_rect = Rect2();
			}
		}
	}
}
void CanvasItemEditor::_restore_canvas_item_state(List<CanvasItem *> p_canvas_items, bool restore_bones) {