Sentence: I was trying to open the lock with the key, but someone had filled the  keyhole with chewing gum, and I couldn't get it in.
 Reason: The 'it' refers to the key because The leading sentence is about a key, and the second sentence is about something not fitting in. 
 Question: Is the above reasoning correct or wrong? 