I looked at your model a little. There were some problems with markers and settings. I did some changes to at least move from the kinematic problems, but please have a look yourself. There should be enough kinematic information for each segment for the optimization to go smoothly. Due to the fact that there is less information than needed - sometimes kinematics fails. You could improve this by introducing additional constrains such as removing optimization of the head size, trunk height, etc.
I also had to add additional constraints to foot, otherwise there was strange subtalar eversion. I believe you do not have enough markers as you provided. I did not use additional markers in the C3D. Please add them and see if they help. Please have a look at the LowerExtremity.main.any file to see how I have done that.