It is the sort of service local people would use to get to Merzouga, it does not stop to visit any sight.
Daily departures from Marrakech start at 8:30am and arrive in Merzouga at 21:00.
From Fez, the night bus will leave at 20.30 (evening) and arrives at 7.15 (morning) in Merzouga. If you want to take this bus and do an early checkin you will need to pay 50 euro per person (MINIMUM 2 PERSONS), and it will include a tour across the dunes and lunch in a restaurant. Alternatevely you can stop in Rissani and visit the city and have lunch there. Then take a taxi from Rissani to Merzouga.
You can find more details regarding the public bus on the website for Supra Tours