Is this essentially a domain problem? You technically have the ability to rotate 180 degrees in your geometry and structure, but the physics makes it so that it is awkward and weird. A simple fix is to add constraints (max/mins) to where you can position your geometry. Otherwise, your model can fit any possible state.
On areas belonging to multiple joints, we have to blend the points. the problem is that we cant linearly combine the points, we need to combine original points to get a point on the manifold.
To philippe-eecs, the second example seems to be "domain problem" but there cases where it is not. In the first case, for example, the joint angle is rather reasonable but still the deformation looks unnatural.