I can agree to it because I experienced it before.
I have 2 reasons before:
1. It's either I can't sleep because I am excited about how to spend my winnings

2. Or I can't sleep because my winnings are not enough and I am still willing to play more, bet more, and expect to grow those winnings.
I don't think it's any of these two, strange but why am I the only one who feel different about what OP is saying? I believe that when someone is telling you not to sleep when you are winning is a warning.
I feel it meant, don't sleep when gambling, the moment when you start to win it's the time to be more extra careful, there is always this type of feeling that come over you after you win in gambling, like relaxation.
I think it's like losing your guide because you just won, it's better to be cautious at the time, take your money and walk away, that winning don't come easily but if you enter the slumber stage (Sleeping mode) you can start feeling special and smart about yourself.
Unfortunately this has lead to many people losing all they have won once again and the chance might never present itself again until further notice.