I'm having the same issue.
I got the code from ATT. Tried entering it, says incorrect code (It is correct though). Then I try entering it again and it says SIM error. After that any number I put doesn't use up an attempt in order for me to finish all my attempts and try the PUK method.
Any...