### Godot version

v4.0.stable.official [92bee43ad]

### System information

Windows10,64,OpenGL API 3.3.0 NVIDIA 425.25 - Compatibility - Using Device: NVIDIA Corporation - GeForce MX250

### Issue description

When I change the tileset texture area size, godot crashes with the following error

The tileset contains a 107*35 sprite sheet

```
ERROR: UndoRedo history mismatch: expected 0, got 2.
   at: (editor/editor_undo_redo_manager.cpp:108)
```

### Steps to reproduce

1. create a tilemap node
2. create a tileset
3. click the tileset
4. drag the spritesheet(107*35) into the tileset
5. click yes with "auto create tiles in non-tra... "pop
6. change the tileset texture region size
7. program freezes
8.
 ```
ERROR: UndoRedo history mismatch: expected 0, got 2.
   at: (editor/editor_undo_redo_manager.cpp:108)
```

### Minimal reproduction project

[test1.zip](https://github.com/godotengine/godot/files/10918599/test1.zip)

DisplayServer::get_singleton()->clipboard_set(warning->get_text());
}
void EditorNode::_dock_floating_close_request(WindowWrapper *p_wrapper) {
	int dock_slot_num = p_wrapper->get_meta("dock_slot");
	int dock_slot_index = p_wrapper->get_meta("dock_index");
	
	Control *dock = p_wrapper->release_wrapped_control();
	dock_slot[dock_slot_num]->add_child(dock);
	dock_slot[dock_slot_num]->move_child(dock, MIN(dock_slot_index, dock_slot[dock_slot_num]->get_tab_count()));
	dock_slot[dock_slot_num]->set_current_tab(dock_slot_index);
	floating_docks.erase(p_wrapper);
	p_wrapper->queue_free();
	_update_dock_containers();
	_edit_current();
}
void EditorNode::_dock_make_selected_float() {
	Control *dock = dock_slot[dock_popup_selected_idx]->get_current_tab_control();
	_dock_make_float(dock, dock_popup_selected_idx);
	dock_select_popup->hide();
	_edit_current();
}
void EditorNode::_dock_make_float(Control *p_dock, int p_slot_index, bool p_show_window) {