### 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
for (CanvasItem *ci : modified_canvas_items) {
		CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(ci);
		if (se) {
			undo_redo->add_do_method(ci, "_edit_set_state", ci->_edit_get_state());
			undo_redo->add_undo_method(ci, "_edit_set_state", se->undo_state);
			if (commit_bones) {
				for (const Dictionary &F : se->pre_drag_bones_undo_state) {
					ci = Object::cast_to<CanvasItem>(ci->get_parent());
					undo_redo->add_do_method(ci, "_edit_set_state", ci->_edit_get_state());
					undo_redo->add_undo_method(ci, "_edit_set_state", F);
				}
			}
		}
	}
	undo_redo->add_do_method(viewport, "queue_redraw");
	undo_redo->add_undo_method(viewport, "queue_redraw");
	undo_redo->commit_action();
}
void CanvasItemEditor::_snap_changed() {
	static_cast<SnapDialog *>(snap_dialog)->get_fields(grid_offset, grid_step, primary_grid_steps, snap_rotation_offset, snap_rotation_step, snap_scale_step);
	EditorSettings::get_singleton()->set_project_metadata("2d_editor", "grid_offset", grid_offset);
	EditorSettings::get_singleton()->set_project_metadata("2d_editor", "grid_step", grid_step);
	EditorSettings::get_singleton()->set_project_metadata("2d_editor", "primary_grid_steps", primary_grid_steps);
	EditorSettings::get_singleton()->set_project_metadata("2d_editor", "snap_rotation_offset", snap_rotation_offset);
	EditorSettings::get_singleton()->set_project_metadata("2d_editor", "snap_rotation_step", snap_rotation_step);
	EditorSettings::get_singleton()->set_project_metadata("2d_editor", "snap_scale_step", snap_scale_step);
	grid_step_multiplier = 0;
	viewport->queue_redraw();
}
void CanvasItemEditor::_selection_result_pressed(int p_result) {