Thanks for the clarification of your situation....
After explaining the situation a little clearer, then the issue may not be that you are in contract, but the system is treating your account like it needs to fulfill the original 24 month commitment. I do not believe there is any requirement to purchase the iPhone directly from At&t. I would call Customer Service and escalate to a manager who may be able to override it.
Good luck. You weren't very clear in your previous statements so it sounded like you were trying to play the system.
BTW: I used to be a CS rep for At&t so I do have a little insight. That is also why I was skeptical of your original inquiry.