Oooof, that's gonna be a longish post, so apologies in advance, but it's tricky to talk about Lt. Pierce (the other char in that example) without massive spoilers.
What could Moftiss have done differently to make shippers happy? At that point (S3/4-ish), it would've been kinda tricky, because they handled it so diffently right from the beginning. For starters, that other show's protagonist, Lucifer, is openly bisexual (well considering that angels, humans and demons are different species, more like pansexual) and nobody bats an eyelash about that (with him also openly stating that he's the former Prince of Hell, most eyelashes are kept quite busy otherwise ) or questions it. Most importantly, it's never treated as a joke the way John "I'm not gay" Watson's frequent clarifications of his orientation are, or his string of failed relationships before Mary for that matter. Fwiw, I think they did a much better job with Sherlock's "not interested, but feel free to speculate, like I would care" attitude. I don't think that whole TJLC business would've become quite that clusterF*** if they'd treated John's sexuality with a bit more respect from the beginning - if you want to bring across that your char is straight and confident in his sexuality, don't have him utter angry denials in almost every episode, and make him at least a bit competent at having a non-psycho girlfriend.
Which brings me to the second char in the above example, Pierce. Who is just that, quietly and unquestioned straight, yet he and Lucifer have a quite different kind of biblical relationship (it's that kind of show). So there is a strong connection between the two of them, never shown as sexual (but leaving room for shippers to interpret it as turning into such if they so choose). The show presents a reasonably logical (hey, it's about the literal Devil taking a vacation in Los Angeles, which puts logic under a bit of strain from the get-go ) explanation for why it's the two of them who have to play that couple, and the chars themselves are at a point in the storyline where an, er, project of theirs that's rather important to Pierce looks like a massive failure. They squabble about this at their "housewarming party", leaving the assembled neighbours to think it's a lover's spat, then when Lucifer returns and presents a heartfelt apology to Pierce, complete with the offer to keep trying to solve this together, this elicits a chorus of "Awww"s from their audience, at which point Lucifer realizes that they still have a role to play and passionately locks lips with the lieutenant, to the latter's surprise.
tl;dr: that scene is not treated like an off-hand joke, but carefully set up and fitting into the general storyline. So, to come back to your question, how could Moftiss have made Johnlockers happy? (and yes, I do realize that hindsight is 20/20)
At the danger of repeating myself, but respect plays a big part in that answer, I think. Respecting both their chars and their fans, in this particular instance. Even assuming that S1/2 (which didn't draw nearly that amount of fire) had already happened, they could have started by, say, taking Sherlock's return (and the emotional impact it has on John) a bit more seriously - they never fully explained what happened, dropped the "is Sherlock a fraud or isn't he?" storyline like a hot potato, and that dinner scene felt so jarring to me at least. Compare and contrast to the way Sherlock and John relate to each other in the marriage episode, of all places.
Again, Lucifer never showed the two characters mentioned in any kind of canonical sexual relationship (without getting into spoiler territory, but quite the opposite actually). And they didn't have to - grain-of-salt-time again as I'm not in that fandom, but I didn't get the impression that there was any kind of backlash about how things went down between them at the end of the third season. Fans are generally quite happy with AU fics if (!) given a reasonable frame to place them in. So, to answer the question at the long last: play out the Return differently, to give the connection between Sherlock and John a chance to reestablish in S3, don't close the door on Johnlock so vehemently both in-show and in interviews. I don't think anyone (well, there's always the odd one out, but you know what I mean) would have minded John marrying Mary then, and shipper fans probably would've loved a scene of, say, Sherlock pulling John into a kiss to hide both their faces from someone they were currently shadowing who'd unexpectedly turned around.