Will state be paid twice?

I owe $2,200 to the state so I agreed to auto deduct a payment the end of this month as I will be receiving a $3,900 from my federal return. However, after completing filing, it said I would be receiving a federal refund of $1,700 instead of the $3,900, which means someone is deducting the $2,200 from the federal return from the state. If that's true, why did I need to agree to debit the $2,200 from my checking? This is strange. Are the feds trying to keep this money?