You know all these absolutely mind-blowing famous stories about some sleepwalkers?
Sherlock is a sleepwalker and spends a good part of his life sleepwalking and doing various things while he's asleep. This is a result of his sleep deprivation and probably past drug use, too. His mind is still at least partially working when it happens. He can unknowingly solve cases and do other stuff, but things can look quite odd to anyone who witnesses him like that.
There can be more to it. For example, John is just a reoccurring part of his dreams and is not real. Sherlock refuses to believe it once he learns about it and is absolutely devastated and has a breakdown. John can be real though, as someone Sherlock has seen in real life; for example, John can be an A&E doctor, whom Sherlock has only seen once when he was injured/overdosed. Mycroft can involve John into Sherlock's healing process, once Sherlock's illness becomes known.
Sherlock does require sleep... he just sleepwalks a lot. Mental Health Issues.
Sherlock is a sleepwalker and spends a good part of his life sleepwalking and doing various things while he's asleep. This is a result of his sleep deprivation and probably past drug use, too. His mind is still at least partially working when it happens. He can unknowingly solve cases and do other stuff, but things can look quite odd to anyone who witnesses him like that.
There can be more to it. For example, John is just a reoccurring part of his dreams and is not real. Sherlock refuses to believe it once he learns about it and is absolutely devastated and has a breakdown. John can be real though, as someone Sherlock has seen in real life; for example, John can be an A&E doctor, whom Sherlock has only seen once when he was injured/overdosed. Mycroft can involve John into Sherlock's healing process, once Sherlock's illness becomes known.