The night at Muzdalifah is part of the Haji journey, and the Sunnah is to pray Maghrib and Isha combined and shortened (qasr) upon arrival from Arafah, then rest until shortly before Fajr. If a jamaah haji falls asleep and misses the combined Maghrib and Isha shalat, they must pray them as soon as they wake up, because Nabi (shallallahu alaihi wa sallam) said: 'Whoever sleeps through a shalat or forgets it, let him pray it when he remembers it, for that is its time.' Prayer is never waived due to sleep or forgetfulness.
Regarding the stay itself at Muzdalifah, the majority of scholars (Hanafi, Maliki, Shafi'i) consider it wajib (wajib). The Hanbali school considers it a rukun (pillar) of Haji according to one opinion, though the well-known position is that it is wajib. Sheikh Ibn Baz held that the stay at Muzdalifah is wajib, and missing it without a valid excuse requires a dam (sacrifice). If a jamaah haji was present at Muzdalifah even briefly during the night or before Fajr, they have fulfilled the requirement.
Sheikh Ibn Uthaymeen clarified that if a jamaah haji arrived at Muzdalifah, fell asleep, and woke up after Fajr having missed the entire nighttime doa and the Fajr shalat at Muzdalifah, they should pray what they missed immediately. Their Haji is valid because they were physically present at Muzdalifah. However, they missed the Sunnah of the lengthy doa after Fajr at Mash'ar al-Haram. The stay itself was fulfilled by their physical presence during the night, even while sleeping.