### 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
// Adjust casing according to project setting. The file name is expected to be in snake_case, but will work for others.
	String name = path.get_file().get_basename();
	child->set_name(Node::adjust_name_casing(name));
	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
	Ref<Texture2D> texture = ResourceCache::get_ref(path);
	if (parent) {
		undo_redo->add_do_method(parent, "add_child", child, true);
		undo_redo->add_do_method(child, "set_owner", EditorNode::get_singleton()->get_edited_scene());
		undo_redo->add_do_reference(child);
		undo_redo->add_undo_method(parent, "remove_child", child);
	} else { // If no parent is selected, set as root node of the scene.
		undo_redo->add_do_method(EditorNode::get_singleton(), "set_edited_scene", child);
		undo_redo->add_do_method(child, "set_owner", EditorNode::get_singleton()->get_edited_scene());
		undo_redo->add_do_reference(child);
		undo_redo->add_undo_method(EditorNode::get_singleton(), "set_edited_scene", (Object *)nullptr);
	}
	if (parent) {
		String new_name = parent->validate_child_name(child);
		EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton();
		undo_redo->add_do_method(ed, "live_debug_create_node", EditorNode::get_singleton()->get_edited_scene()->get_path_to(parent), child->get_class(), new_name);
		undo_redo->add_undo_method(ed, "live_debug_remove_node", NodePath(String(EditorNode::get_singleton()->get_edited_scene()->get_path_to(parent)) + "/" + new_name));
	}
	if (Object::cast_to<TouchScreenButton>(child) || Object::cast_to<TextureButton>(child)) {