Watching the rooftop scene a second time in the flashback, I was struck by how many people were involved.
Sherlock has said he prefers being alone and that he has only one friend (or perhaps two, if he does count Molly)...but every one of those people in the third scenario held Sherlock's life in their hands. It would only take one of them compromised in some way...blackmail or a bribe by Moriarty, or a listening device...
Maybe Sherlock doesn't have relationships with all of them like he does with John...but that scheme meant a very high level of trust on Sherlock's part, and a very high level of loyalty on all of theirs.