I would assume so, that it’d be akin to a strong one-shot antidepressant. Psilocybin is quickly metabolised to psilocin, which binds to serotonin receptors. It might be more of a risk for a bad trip, though, unless you have good dream control.
Also, you’d definitely need to be rendered unconscious, haha—I can’t imagine trying to sleep naturally on mushrooms, although when I take them I always have the most beautifully restful sleep after coming down.