Sounds like trouble with the keylock lever - a cam type lever on the selector mechanism which prevents shifting the car out of park without the key being inserted and rotating It's a fairly simple mechanism and uses a cable to swing it into the lock/unlock positions when the ignition key is turned.
These little cams can wear and/or the cable may need adjustment. It may just need a cleaning.