The shifter on the I-MiEV is connected by a cable to the transaxle. The switch that tell the car what direction the car is going to travel (i.e. reverse, neutral, forward) is mounted on the transaxle. There is an alignment pin that can be put in the switch to confirm that it is synchronized with the "gates" in the floor shifter. Like another member said, the cable can get out of adjustment. You really need to look at a service manual because you don't want to mess up the crazy key/brake interlock which is also located in the floor shifter. All that being said, the car should never be able to shift out of park by itself. It sounds like something is loose and going to fall off. If you remove the cover over the shifter (console first with screws under the rear and a couple of pushpins) you will see the two small cables out of the front of the shifter and one large cable going to the rear. The large cable the one you are interested in. Make sure the cable anchor is firmly locked in place in the front clamp and the cable end is tight where it attaches with a pin to the plastic part at the bottom of the shifter. Pull on the cable jacket to make sure it is not moving in the clamp. The cable then goes through the floor near the rear of the front passenger seats and comes out just above the left side half-shaft at the transaxle. You might be able to see it with a mirror from the top, but the battery charger will block your ability to really check it out by touch. You will most likely have to get under the car to complete this. You will see the cable jacket is anchored to a clamp (holder) on the transaxle then goes to an arm attached to the shifter shaft that passes through gear selector electrical switch. See if you can find anything loose (cables, clamps, switch mounting, nut holding the arm on, etc.). Have someone move the shifter slowly back and forth and see if you can find any slop in the linkage. The key is synchronizing the switch and the shifter gates with no slop in the system to make it work properly. BTW, the position switch is easy to remove by taking the nut off the shift arm on the transaxle. Then you remove the mounting bolts and the connector and the switch slides off the shaft if you need to replace it.
I had too- typical shift symptoms : car icon, flashing gear indicators, turtle mode. As a full remedy I have avoided using the D gear.
...
That removal mentioned above of shift position sensor [ SPS on the same bolt as the steel shift lever ] may 1st appear impossible. Note the black SPS position.
...
With vise grip brace the lever against rotation of more than 10° to protect the Fragile plastic cable anchor! Better detach cable anchor
[ by removing steel "paper clip" cotter pin at its joint above ].
...
Remove the one 14mm nut and its lock washer [ tight -- I needed a long wrench ],
and the lever then two 10mm bolts. The black plastic SPS has some rotary play, ~3° limit.
Clean the exposed bolt all you like. But prying off the SPS was tedious. After experiment I used table knives and forks, and their handles, 3 places at once, trying to not twist and bind the perfectly snug SPS.
...
The data harness above for removal needs a lever pinch near its top, and excessive effort for a healthy adult.
...
The 8 small screws on SPS right side are rust- prone and soft Philips #2. Good luck. Inside SPS I may find grease
[ what type -- conductive ?
I wonder ] and offending copper debris to remove.