Have you just shut car off and than restarted the car.
I had a similar issue if accidently shut car off in drive. If than restarted the car every thing wouldn't work but shut it off again as was in park and restarted it the car went into gear as it should. Now I always make sure car is in park when I shut it off and many times put in neutral first than in park and shut it down.
I hope this helps as car has a mind of its own at times.