Take a look at Scott Alexander's article on sleep deprivation and mood disorders: https://astralcodexten.substack.com/p/sleep-is-the-mate-of-d...
It has some theories on a synapse level and some AI/NN analogues regarding the paradox of "good sleep = good mood" and yet "no sleep = relief" for depressed people.