### Godot version

4.0.beta9 [e780dc332]

### System information

Windows 10
AMD Ryzen 5 3600
AMD Radeon RX 580


### Issue description



https://user-images.githubusercontent.com/95674438/209506480-be37f1c6-2060-4a98-831d-d5fa495b3e7c.mp4




I brought in my .glb model (a tree) from blender which has two different models in it (one for the bark and one for the pine needles) and wanted to make the pine needles sway a bit. I inherit a new scene with the model and make the mesh unique (recursive) go to surface 1's material and try to convert it to a shadermaterial and it instead converts surface 0's material and on top of that it makes surface 0's material into surface 1's material. 





I decided to go back to godot 4 beta 8 [45cac42c0] and this issue is not present with my model so it is a specific godot bug (there is also a name change between the 2 versions? In beta9 it's surface 0 and surface 1 while in beta8 it's surface 1 and surface 2? just a side note).



https://user-images.githubusercontent.com/95674438/209506818-b4ed3556-ac1f-4aa9-84a9-c2f5113394cd.mp4





### Steps to reproduce

Using the minimal reproduction product:

1) Right-Click the tree.glb in the project files and make a new inherited scene

2) click tree2 in the scenetree and go to the mesh dropdown and click "make unique (recursive)"

3) click on the mesh and go down til you see surface 0 and surface 1

4) right click surface 1's material and press "convert to ShaderMaterial" what happens is surface 1's material stays the same while surface 0's material is the one that changes

### Minimal reproduction project

[tree.zip](https://github.com/godotengine/godot/files/10301635/tree.zip)

lods.push_back(surface.lods[j].edge_length);
			lods.push_back(surface.lods[j].index_data);
		}
		if (lods.size()) {
			data["lods"] = lods;
		}
		Array bone_aabbs;
		for (int j = 0; j < surface.bone_aabbs.size(); j++) {
			bone_aabbs.push_back(surface.bone_aabbs[j]);
		}
		if (bone_aabbs.size()) {
			data["bone_aabbs"] = bone_aabbs;
		}
		if (surface.blend_shape_data.size()) {
			data["blend_shapes"] = surface.blend_shape_data;
		}
		if (surfaces[i].material.is_valid()) {
			data["material"] = surfaces[i].material;
		}
		if (!surfaces[i].name.is_empty()) {
			data["name"] = surfaces[i].name;
		}
		if (surfaces[i].is_2d) {
			data["2d"] = true;
		}
		ret.push_back(data);
	}
	return ret;
}
void ArrayMesh::_create_if_empty() const {