Turns out the problem is that bones where moved across skeletons and there is a bug where the bone's references to the new skeleton are not set properly. Having a bone in one skeleton with references to another skeleton should never happen!
In 3.6.46 we detect and fix this when a project is loaded. Unfortunately the only "fix" is to delete the invalid bones.
Since we don't know exactly how you moved a bone from one skeleton to another to cause the problem, we haven't yet fixed the root cause. However, we have added checks so Spine will crash immediately when such invalid state is detected. This way Spine users will know right away that something has gone wrong and can report to us the steps they were taking to cause the problem so we can fix it.
Sorry for all the trouble!