This sounds like the steering wheel may have been turned until the wheel locked, after the key was turned to the accessory position; either that, or the parking brake was not applied before the shift lever was moved to the "park" position; and the car then rolled until it was stopped by the transmission parking gears. Either of those two moves will usually prevent the key from being removed.
In those situations; if the steering wheel has locked, the fix is either to move the steering wheel in both directions until the position is found where the key releases, or if that doesn't succeed; to jack up the front end of the car until both front wheels are off the ground. This will relieve the pressure on the steering wheel, and enable the key to be released.
If the parking brake was not firmly applied after moving the shift lever into Park; raising the front wheels off the ground will relieve the pressure on the parking gears; which will also free the key.
There may also be a release button for the BST (brake/starter/transmission) interlock on this car. You'd need to consult a dealership about how to activate this feature, if your car has one.