### 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

/
bool res = (access == ACCESS_RESOURCES);
	String current = get_current_dir();
	favorites->clear();
	favorite->set_pressed(false);
	Vector<String> favorited = EditorSettings::get_singleton()->get_favorites();
	Vector<String> favorited_paths;
	Vector<String> favorited_names;
	bool fav_changed = false;
	int current_favorite = -1;
	for (int i = 0; i < favorited.size(); i++) {
		bool cres = favorited[i].begins_with("res://");
		if (cres != res) {
			continue;
		}
		if (!dir_access->dir_exists(favorited[i])) {
			
			favorited.remove_at(i--);
			fav_changed = true;
			continue;
		}
		
		String name = favorited[i];
		if (res && name == "res://") {
			if (name == current) {
				current_favorite = favorited_paths.size();
			}
			name = "/";