Happens with mine sometimes. I just press in the lock button on the gearstick a couple of times, which then tends to send a signal for the ignition to release the key.
I've never got to the bottom of why it does it. It's very intermittent. I've even squirted a small amount of WD-40 in the ignition barrel, which helped. Or seemed too.