All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Your performance of Maghrib and ‘Ishaa’ Prayers before arriving at Muzdalifah was valid and correct, and you were not required to repeat them. That is because combining between Maghrib and ‘Ishaa’ in Muzdalifah is an recommended, not obligatory.
You contradicted the Sunnah by not staying in Muzdalifah till dawn. Hence, if you left Muzdalifah before midnight, every one of you would be required to slaughter an animal according to the majority of scholars and distribute its meat amongst the poor of Makkah. That is because it is not permissible to depart from Muzdalifah before midnight. This is the opinion of the Shaafi‘i and Hanbali scholars, and we hold the same opinion. However, if you departed from Muzdalifah after midnight, there would be no slaughtering required of you.
Allaah Knows best.