### Godot version

4.0.2

### System information

Windows 10 960m

### Issue description

When using the skeltonIK3d on a simple bone chain, the roll axis of bones are not working correctly. As can be seen in this clip comparing 3.5 to 4.0.2, when moving the ik target on the x axis, the bone roll of the shin bone twists in a very strange way.

When the ik target is just moving up and down on the y axis 4.0.2 looks the same as 3.5. I have tried many ways of setting the roll axis in blender before exporting, but this seems to make no difference in godot.

https://github.com/godotengine/godot/assets/7741669/524f9450-8582-4336-96a2-397ffe915d2d

@lyuma I also tried this with your recent fix in master and it does not fix this issue, unfortunately. I did try the scorpion demo scene and I can see that it resolved that. Simple 2 or 3 bone chains seem to exhibit this odd roll issue...maybe the long chain on the scorpion tail is covering up the issue?

On a side note, I am getting tons of crashes trying to test out simple ik with the standard tool script. Especially just clicking in the skeletonik3d node. 

### Steps to reproduce

- import a simple 2 or 3 bone skeleton such as a leg
- add a skeltonik3d node
- fill in the node parameters and add a marker3d as target
- add a tool script to start off the ik solve
- move the ik target on the x axis and observe the twisting

### Minimal reproduction project

This has the 3.5, 4.0.2 file and the blend file

[ik_roll_bug.zip](https://github.com/godotengine/godot/files/11521836/ik_roll_bug.zip)

ERR_FAIL_COND_V(-1 == p_task->root_bone, false);
	Chain &chain(p_task->chain);
	chain.tips.resize(p_task->end_effectors.size());
	chain.chain_root.bone = p_task->root_bone;
	chain.chain_root.initial_transform = p_task->skeleton->get_bone_global_pose(chain.chain_root.bone);
	chain.chain_root.current_pos = chain.chain_root.initial_transform.origin;
	chain.middle_chain_item = nullptr;
	
	Vector<BoneId> chain_ids;
	
	int sub_chain_size;
	
	chain_ids.resize(p_task->skeleton->get_bone_count());
	for (int x = p_task->end_effectors.size() - 1; 0 <= x; --x) {
		const EndEffector *ee(&p_task->end_effectors[x]);
		ERR_FAIL_COND_V(p_task->root_bone >= ee->tip_bone, false);
		ERR_FAIL_INDEX_V(ee->tip_bone, p_task->skeleton->get_bone_count(), false);
		sub_chain_size = 0;
		
		BoneId chain_sub_tip(ee->tip_bone);
		while (chain_sub_tip > p_task->root_bone) {
			chain_ids.write[sub_chain_size++] = chain_sub_tip;
			chain_sub_tip = p_task->skeleton->get_bone_parent(chain_sub_tip);
		}
		BoneId middle_chain_item_id = (BoneId)(sub_chain_size * 0.5);
		
		
		ChainItem *sub_chain(&chain.chain_root);
		for (int i = sub_chain_size - 1; 0 <= i; --i) {
			ChainItem *child_ci(sub_chain->find_child(chain_ids[i]));