The moon phases change immediately after sleeping, meaning when the moon is setting beyond the horizon after sleeping, it is a different phase than what it was before sleeping. There are two screenshots, 1 is before sleeping at night, 2 is after sleeping before that same moon goes beyond the horizon.
To reproduce:
wait until time is at night and look at moon phase
sleep in bed for the entire night
look at moon when it is going down
The moon changes phase exactly at dawn (time 0), whether you sleep or not