In my case, the bones had a roll that made the axis point in the wrong direction. If you are using Blender, make sure the tilt is set to zero. To do this, select the armature, go to edit mode, and select the bone. In the n-panel, go to ‘item’ and make sure that ‘roll’ is zero. That solved the problem to me.