[5-0] Control Rig: Unable to correctly set a baisc IK without the mesh to get messed up

I believe my problem is related to this topic: Is there a way to change the axis of rotation of a bone in your armature?

The bone axis orientation seems to be problematic.