When you use independent layers, you normally nest them under the thing the attach to. For example, the foot is normally attached to the end of the leg, so nest the foot inside the leg group. The the green line attaching the foot to the body should instead attach the foot to the end of the leg. Ideally the artwork should overlap a bit to connect properly. I would try that first and see if it fixes things. My guess is it's going weird because the foot is a long way away from the body but attached to it. It could be confusing it.