I'm pretty sure it's the SIM, as the "Enter code to remove operator lock" (which the TM rep insisted meant the phone was carrier-locked) only appears when the SIM is installed.