### Godot version

4.1 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

Trying to move a folder results in moving error and it's not moved.
Regression from #75330

A fix already exists, but I'm opening an issue so it's not lost (the PR isn't ready and not very active).

### Steps to reproduce

1. Add 2 folders in filesystem
2. Move one folder into another one

### Minimal reproduction project

N/A
Ref<InputEventMouseMotion> mm = p_event;
	if (mm.is_valid() && holding_branch) {
		const int item_idx = files->get_item_at_position(mm->get_position());
		if (item_idx != -1) {
			files->deselect_all();
			String fpath = files->get_item_metadata(item_idx);
			if (fpath.ends_with("/") || fpath == "res://") {
				files->select(item_idx);
			}
			TreeItem *deselect_item = tree->get_next_selected(tree->get_root());
			while (deselect_item) {
				deselect_item->deselect(0);
				deselect_item = tree->get_next_selected(deselect_item);
			}
			
			TreeItem *tree_item = tree->get_item_with_text(files->get_item_text(item_idx));
			if (tree_item) {
				tree_item->select(0);
			} else {
				
				fpath = fpath.substr(0, fpath.rfind("/") + 1);
				if (fpath.size() > String("res://").size()) {
					fpath = fpath.left(fpath.size() - 2); 
					const int slash_idx = fpath.rfind("/");