There are all kinds of things that could do this. Unless there was something obvious like the speedometer failing to work, the only way you will know is to take it to a shop with the proper scanner to access the transmission computer for stored error codes. Since the car was stuck in second gear (limp mode) an error code (or codes) would be stored in the transmission computer. Without the scan, the guess could be anything from a sensor to a worn out transmission.