I believe the ignition switch needs power in order to get the key out. I just recently went through a bad battery connection issue that caused a similar issue. The big clues are that it wont start and wont let you back the key out, both power related.

So I would make sure all the big electrical fuses are good, any of them dealing with ignition, charging or starting. Then go to the connections, particularly the battery connections.