I don't have experience with your machine specifically, so you'll have to do some digging to figure out which diagnostic parameters to look at, but this should get you looking in the right direction.
Most likely, the machine is simply confused as to what tool is in the spindle, in the side arm, in the pocket, or some combination of it all.
In my experience with several of our 0m controlled machines, there are diagnostic parameters which store information about what tool the machine has. For more complicated machines that have swing arms, random tool pockets, and sub-pockets for pre-staging tools, the machine has to keep track of which tool it has, and where.
On one of our machines specifically, if you turn the machine off while it is doing stuff with the tool changer, it will go stupid, not have a clue where it is or what tools it has in the spindle or sub arm, and I have had it do similar to what you are experiencing.
What you need to do is look in manuals (if you have any) for tool change information. The information would be stored in a "D" diagnostic parameter on the diagnostics page. It may be in the 400+ range of diagnostic parameters, although it could be lower or higher - it is up to the machine tool builder.
In my mind, if we assume you try to change to tool 1 and this happens, it might think it has T1 in the spindle AND the sub arm AT THE SAME TIME, which confuses it, so it tries to correct the situation. In a case like this, you'd set the spindle tool diagnostic to 1, sub arm/pocket to 2 (or 0 maybe, depends on how it is set). While you are here, you'd also want to make sure that the tool change pot that is facing the tool changer matches the diagnostic bit.
If the tool changer is a "random pocket" type where any tool number could be in any pocket, you might find a whole list of diagnostic D parameters that contain information about which tool is in which pocket, and if that was the case, you'd have to sort it out in a similar manner.
I hope that helps.