Whoever got the 2nd payment will have to refund the money. If the patient got a check dated before your check, they should have paid the doctor, so the check the doctor got was an overpayment. (I understand EVEN if the Assignment of Benefits was signed, the insurance company screwed up, but they won't look at it that way.) If you got the check first, then the patient will have to return the money to the insurance company, and good luck with that. (It's wrong, but that's the way it is, most of the time the patients won't do what's right.) The insurance company KNOWS that they will get the money from the doctor some way some how, they may not ever get it from the patient.
But BE SURE to bill the patient for what they owe. And attach a letter showing that you are aware that they received the funds from the insurance company.