Currently, I have a ragdoll figure, which consists of a parent node (without attached physical bodies) and many child nodes, each of which consists of a circle body. Circles are connected to each other using SKPhysicsJointPin between each circle:

Each SKPhysicsJointPin has shouldEnableLimits = true , and currently I'm using the values ββ-0.05 and 0.05 for lowerAngleLimit and upperAngleLimit respectively.
This works very well and does not allow the deformation to deform too much, unless the figure goes upside down as a whole, in which case all the joints suddenly try to compress, for example:

The joints conclude very quickly when the figure is completely upside down. When he turns again, all joints return to normal. Why is this happening? How to maintain proper joint angles?
Change 1:
I just tried to rewrite the project in Objective-C if this happened due to some strange Swift error; this problem still shows up in Objective-C, so I removed the Swift tag.
My best guess at the moment is that the angle of the joints relative to the world is incorrectly calculated by SpriteKit, when the bodies to which they are attached rotate more than 180 Β° in any direction, and therefore the wrong angles are transferred to the Box2D base joints.
I was not sure whether I should constantly update the limits of the lower and upper corners to match the world angles of their bodies, but it does not seem to be the same as when the body is very close to the -DD joints stop working properly. Anyway, I will continue to experiment ...
Edit 2:
Now I am sure that the problem arises because SpriteKit (I think, not without reason) changes the value of zRotation to keep it between -180 Β° and 180 Β°. If, for example, the node rotates clockwise and reaches -180 Β°, SpriteKit automatically wraps its value back to + 180 Β°. I'm pretty sure this wrap makes the joints behave erratically, I just need to figure out how to counteract this ...
Edit 3:
I downloaded an example application (including video) that demonstrates this problem as originally requested by Apple: Xcode Project / Video