Ah, I think I understand what you're getting at. The ฝันดี is the more common day-to-day expression that is said to somebody that is going to sleep, whereas ราตรีสวัสดิ์ is probably overly formal in comparison to it
As an English-speaker learning Thai, it was easy for me to assume that ฝันดี (and นอนหลับฝันดี) equated more to the English phrases such as "sleep well" or "sweet dreams", and there's probably still some merit in that thought, when the phrase is considered word-for-word.
I guess in the English-world, it's common to use the phrase "Good night!" to somebody first, and then perhaps follow it up with a secondary message afterwards of "Sleep well!", or "Sweet dreams!".
Just as an aside to this point, I remember hearing that within a Thai family, it's not common for family members to say such expressions as "good night" and "sweet dreams" to one another, and that they simply just head to their bedrooms and go to sleep. I.e., there isn't such a strict social protocol to say such things to one another, it is quite acceptable not to say it too.
It reminded me of a personal experience where I needed a writing pen, and a Thai friend gave me her pen. I said thank you (ขอบคุณนะครับ) and she looked at me funny and explained to me that I don't need to say "thank you" for simple things like somebody giving a pen.
Anyway, just thought I'd share. Happy to hear any further thoughts from you on this topic too.