Have Military Law Questions? Ask a Military Lawyer.
Based upon what you have said, your early discharge is the reason for the recoupment. Just because you honorably served your second enlistment doesn't mean that your second contract was fulfilled. Its all about numbers and calculations for DFAS and pay matters. Each service may have specific regulations but DFAS will refer to the DoDFMR Volume 7A.
You should contact DFAS directly and speak to someone so they can explain their action.