I'll look again later but a quick search pulled this info on the code...
P1731-INCORRECT GEAR ENGAGED
For a complete wiring diagram Refer to Section 8W
Theory of Operation
The Transmission Control Module (TCM) constantly calculates the transmission ratio based on the input speed sensor 1 and 2 (N2-N3) signals and the calculated output shaft speed. The intent of this diagnostic is to detect if the transmission is trying to mechanically shift into a different gear than the TCM intends.
NOTE: The transmission control module is programmed to immediately place the transmission into neutral if P0730 or P1731 codes are set. These codes indicate that the transmission experienced an unknown or incorrect gear ratio. Placing the transmission in neutral prevents potential catastrophic failure. When this occurs, the transmission will remain in neutral until the vehicle slows to 29 Km/h (18 mph).
When Monitored: Engine rpm greater than 450 rpm, no N2 - N3 input speed sensor errors present, no gear selector lever errors present, no ABS system errors, and vehicle speed above 10 Km/h (6 mph).
Set Condition: No shifting operation and actual gear differs from the target gear. No shifting operation - actual (calculated) gear differs from target (expected) gear, actual (calculated) turbine speed is greater than 300 rpm or calculated transmission ratio is above threshold. During an Upshift - actual (calculated) gear is less than target (expected) gear. During Downshift - actual (calculated) gear is greater than target (expected) gear. Exception: Actual (calculated) gear is 1st and target (desired) gear is 2nd.
LOW FLUID LEVEL
ABS DTCS PRESENT
TRANSMISSION SOLENOID, SPEED SENSOR AND/OR OTHER ELECTRICAL RELATED DTCS PRESENT
INTERMITTENT STICKING VALVE IN THE VALVE BODY
INTERNAL TRANSMISSION PROBLEM
TRANSMISSION CONTROL MODULE