When you pin the beam element ends, pin End A in the 456 directions and End B in the 56 directions or vice versa.
If you pin both ends of a beam element in torsion (direction 4) it is free to spin about the axial axis causing excessive pivot ratios. Pinning one end in torsion is equivalent to...