Disclaimer: I personally have not tried this so I can't verify if it is true or not, but I can see some different things online and I will try my best to explain what I've seen.
Fist of all, this article: https://www.trustedreviews.com/news/does-the-nintendo-switch-download-faster-in-sleep-mode-2950839
^^ talks about the subject and claims that while in sleep mode and docked, their nintendo switch was able to download game titles about 15% faster than while not. They tested the theory themselves and that is what they determined. Also, they share this video which apparently they got the original concept from: