I am get frustred by these kind of special cases. Thanks for your inquiry. The degree of freedom problem is one of the most vexing in assembly analysis. They also must recognize redundant constraints. Quite a lot of work has been done by the kinematic and dynamic software developers, but their work is generally proprietary.
Some systems can even suggest which constraints to remove.
Dr. Chris Hoffman, at Purdue U, and Dr. Dan Whitney, at MIT, are both working in this area. You can visit their websites and look at their papers. There are no easy answers. There will always be special cases to identify and deal with. We are all struggling with the same problem.