Why Darija sounds different
The first part of the good-night wish can sound almost like a cluster of consonants to a new learner. Moroccan Arabic frequently has shorter or fewer vowel sounds than the forms presented in introductory standard Arabic courses. Start slowly and notice how the sounds join together rather than insisting on pronouncing each letter separately. Online transliterations sometimes use the numbers 3 and 7 for Arabic consonants, so a message written in Latin characters may not look like the pronunciation guides here.
A night-time wish in a multilingual conversation
French bonne nuit is a useful option when the conversation is already in French. It should not be confused with bonsoir, which can open an evening conversation, or bonne soirée, which wishes someone an enjoyable remaining evening. Morocco is also home to diverse Amazigh speech communities. Their languages are not interchangeable with Darija, and it is better to learn a locally appropriate expression from your host than to treat a translation from a different community as universal.
Ending a visit without sounding abrupt
When you have spent an evening with hosts, a night-time wish can follow a thank you for the meal or conversation. There is no need to deliver a long formula if you are still finding your feet with Darija. Listen for the form of address used around you, and reserve intimate sleep or dream wishes for people you know well. If the person is continuing their evening rather than preparing to sleep, an ordinary farewell may fit better. The intended situation matters more than the hour shown on your phone.