Firstly, don’t panic!
There’s only one bus a day with the Supratours bus company from Marrakech to the desert so if you missed it then you can’t get another one the same day.
But the CTM bus company has a bus leaving every day at 10.15 to Errachidia which is quite nearby. From Errachidia you could get a taxi straight to the desert village of Hasilabied and it would probably only cost about 200-300 dirhams.
And if the CTM bus is full you would go to the Gare Routierre which is the local bus station and see which local buses can take you to Errachidia or, even better, to Rissani, which is the nearest big town. From there you can get a shared taxi for 15 dirhams or just pay the whole taxi for 90.
Once in the desert village of Hasilabied you will see the dunes already and you go to the Hotel Les Flaments Rouge and ask them to call Yusuf. Yusuf is the guy who owns the camp in the dunes. And his number +212 670786734 he speaks a little English and fluent French and Spanish. He would then bring you out to the camp.