I was listening to a sleep scientist the other day and they were saying that one thing we know is that depressed people have more rem sleep on average, and SSRIs decrease the amount of rem sleep.
If it is something sleep based that goes some way to explaining why it takes time to have an effect. Building up or wiping out a sleep debt can’t happen instantaneously.