### 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 (GLTFSkeletonIndex skel_i = 0; skel_i < p_state->skeletons.size(); ++skel_i) {
		Ref<GLTFSkeleton> gltf_skeleton = p_state->skeletons.write[skel_i];
		Skeleton3D *skeleton = memnew(Skeleton3D);
		gltf_skeleton->godot_skeleton = skeleton;
		p_state->skeleton3d_to_gltf_skeleton[skeleton->get_instance_id()] = skel_i;
		
		skeleton->set_name("Skeleton3D");
		List<GLTFNodeIndex> bones;
		for (int i = 0; i < gltf_skeleton->roots.size(); ++i) {
			bones.push_back(gltf_skeleton->roots[i]);
		}
		
		
		bones.sort();
		while (!bones.is_empty()) {
			const GLTFNodeIndex node_i = bones.front()->get();
			bones.pop_front();
			Ref<GLTFNode> node = p_state->nodes[node_i];
			ERR_FAIL_COND_V(node->skeleton != skel_i, FAILED);
			{ 
				Vector<GLTFNodeIndex> child_nodes;
				for (int i = 0; i < node->children.size(); ++i) {
					const GLTFNodeIndex child_i = node->children[i];
					if (p_state->nodes[child_i]->skeleton == skel_i) {
						child_nodes.push_back(child_i);