The TCP rotation can be limited by using the Allow a tool Z rotation of +/- option in the menu. If the option is active, the X and Y rotations are locked while the Z rotation is limited to the value selected (e.g., +/- 45°).
This feature functions as the opposite of the Constrained Space, forcing the solver to operate in cartesian space to restrict the tool's orientation. It locks the X and Y rotations, while the Z-axis rotation can be limited to a specific degree range (plus or minus a set value). If the value of this field is set to "0", the Z rotation is also locked along with the X and Y rotations. To keep the rotations of all three axes (X, Y, and Z) unlocked, use a value of "-1" in this option.