I had the same error message, gear box not in park, as my wife couldn't put the rotary knob in park before shutting down the engine. After that the knob wouldn't turn and couldn't start the car (the D indicator in gear selector was flashing).
I took the center consol apart and removed the gear selector assembly (fairly straightforward). Removing a plastic cover on the assembly reveals connectors for shifter interlock solenoid and actuator for the knob to go up and down, remove the connectors. Using a power supply (I dialed in 10V) or 9v battery, power the connectors individually to verify if these are working. Also, you may need to power the actuator to move all the way up, if it's stuck in the down position, that way you could open the assembly enough for further steps. In my case, both the actuator and solenoid were working. The problem must have been in the shifter circuit that it wasn't sending signal to the solenoid (I verified that brake switch was working).
Next step would be to remove the longer hex bolts on the assembly to open it up. You will see a sliding plastic mechanism with a pole, which is the interlock. In my case, I bypssed the interlock by pulling it all the way back and putting a zip tie around it. In my view, given the shifter is rotary, there is less chance of it getting turned accidentally, so this temporary fix might be okay for a while.