Here an example with which I could reproduce the bug multiple times:
Create a ship. Place 4 turret axis anywhere and with different directions. Attach to these each a new ship with a rail docker. If you cycle through the docked ships now, the up and down key will work fine.
If you place a new turret axis on any of the docked ships and attach a new core, cycling through all docked ships will bring you at least twice to any of the docked cores (can't predict which) before you come back to the core.
Adding another "barrel" will change the cycle so that you now cycle between the two turrets with barrels and the core. Ignoring the other turrets completly.
Even more strange if you reload the scene/game the order of the cycle changes and most annoying is that it sometimes changes so that you cant cycle back to your main core.