### Godot version

0810ecaafdbee3ea747219e6ab3a8de5d2216a09

### System information

Windows 11, Nvidia 3000, firefox

### Issue description

Exporting the gltf file is corrupt in blender.

### Steps to reproduce

1. Open project.
2. Export as glb
3. Open in blender
4. Blender display many warnings

![image](https://user-images.githubusercontent.com/32321/216740742-de662c5c-f5c3-44b5-a36e-8ad33defdbba.png)


### Minimal reproduction project

https://cdn.discordapp.com/attachments/598003845657788438/1071249610896580691/Test_Game_Project.zip


for (int i = 0; i < roots.size(); ++i) {
		GLTFNodeIndex current_node = roots[i];
		while (p_state->nodes[current_node]->height > maxHeight) {
			GLTFNodeIndex parent = p_state->nodes[current_node]->parent;
			if (p_state->nodes[parent]->joint && p_skin->joints.find(parent) < 0) {
				p_skin->joints.push_back(parent);
			} else if (p_skin->non_joints.find(parent) < 0) {
				p_skin->non_joints.push_back(parent);
			}
			current_node = parent;
		}
		
		roots.write[i] = current_node;
	}
	
	bool all_same;
	do {
		all_same = true;
		const GLTFNodeIndex first_parent = p_state->nodes[roots[0]]->parent;
		for (int i = 1; i < roots.size(); ++i) {
			all_same &= (first_parent == p_state->nodes[roots[i]]->parent);
		}
		if (!all_same) {
			for (int i = 0; i < roots.size(); ++i) {
				const GLTFNodeIndex current_node = roots[i];
				const GLTFNodeIndex parent = p_state->nodes[current_node]->parent;
				if (p_state->nodes[parent]->joint && p_skin->joints.find(parent) < 0) {
					p_skin->joints.push_back(parent);