I added a motor joint to yellow, and it did stop it from getting displaced, but red still gets displaced, and yellow also gets displaced if I make the black sprite collide with yellow directly.
From what I can see the C2 Physics just stops or slows down its rotation to prevent displacement while Chipmunk just rotates regardless, which I guess is a more consistent but with the side effect of displacement.
I guess it is how it is. Only if the standard C2 Physics had collision filtering per instances of the same object like Chipmunk does. And looking at the files It looks impossible to hack it into the C2 physics behavior.