This happened to me today. Of course, as always, AT&T couldn't figure out the problem and of course Nokia says AT&T is the one responsible for unlocking the phone.
Now recently, I also had an Android phone on T-Mobile that wouldn't accept the correct unlock code. Long story short, I eventually got the phone to accept it after messing around with it. With that recent success, I thought I'd try to get the Lumia to accept the code and see what happens. So what I did was:
1. Get an active SIM card. MUST be active so you can get the PUK code.
2. Call up support for whatever carrier the SIM is for and get the PUK code, write it down.
3. If you're using an AT&T SIM (including an AT&T MVNO), dial ##782# and press call to bring up the unlock code prompt. If using any other SIM, it should automatically prompt for the unlock code upon startup.
4. Enter the unlock code until you run out of attempts. Your SIM card will now be locked and ask for the PUK code.
5. Enter the PUK code. It then prompts you to setup a new SIM PIN. Do that, and write it down in case you ever need it in the future.
6. If the code is correct, it'll say something like it's correct or accepted, and the SIM card will be unlocked again. Now try entering the unlock code to unlock the phone. You may need to use the ##782# menu.
For me, it actually popped up asking for a PUK code again even though my PUK was already successfully accepted. This was most likely because of me entering the unlock code wrong ten times with an inactive T-Mobile SIM, then later entering the unlock code wrong an addition three times with an active Straight Talk SIM. I unlocked the Straight Talk SIM with it's PUK, so I'm assuming it now wants the T-Mobile PUK, which there is none since it's an inactive SIM. So instead, I tried my unlock code given by AT&T and it accepted it and unlocked my phone.