### Godot version

v4.2.dev4.mono.official [549fcce5f]

### System information

window10 64bit

### Issue description

![GIF 2023-9-1 22-39-07](https://github.com/godotengine/godot/assets/35988767/d7be4a45-f5f0-4408-8758-f4bf9f3c9c5d)


### Steps to reproduce

/

### Minimal reproduction project

/
int current = favorites->get_current();
	if (current > 0 && current < favorites->get_item_count()) {
		Vector<String> favorited = EditorSettings::get_singleton()->get_favorites();
		int a_idx = favorited.find(String(favorites->get_item_metadata(current - 1)));
		int b_idx = favorited.find(String(favorites->get_item_metadata(current)));
		if (a_idx == -1 || b_idx == -1) {
			return;
		}
		SWAP(favorited.write[a_idx], favorited.write[b_idx]);
		EditorSettings::get_singleton()->set_favorites(favorited);
		_update_favorites();
		update_file_list();
	}
}
void EditorFileDialog::_favorite_move_down() {
	int current = favorites->get_current();
	if (current >= 0 && current < favorites->get_item_count() - 1) {
		Vector<String> favorited = EditorSettings::get_singleton()->get_favorites();
		int a_idx = favorited.find(String(favorites->get_item_metadata(current + 1)));
		int b_idx = favorited.find(String(favorites->get_item_metadata(current)));
		if (a_idx == -1 || b_idx == -1) {
			return;
		}
		SWAP(favorited.write[a_idx], favorited.write[b_idx]);
		EditorSettings::get_singleton()->set_favorites(favorited);
		_update_favorites();
		update_file_list();
	}
}
void EditorFileDialog::_update_favorites() {