Obviously their boggarts would be each other’s corpses.
If Sherlock hadn’t known what it was John was seeing, he would have rolled his eyes; would have cast the spell himself; would have scolded John for freezing up at the sight of his worst fear. They were third year students who had tangled with trolls , aggravated acromantulas, and made friends with the merfolk of the Black Lake. This wasn’t above them by any means, and John was a capable-enough wizard to know how to best a boggart.
However, Sherlock knew exactly what it was John was seeing. He was there, behind the line, watching the boy panic at the sight. And, he had seen the same when he had taken his turn with the beastly boggart: the corpse of his best friend.
(John’s throat bit out by some monster or other, his eyes turned up to the ceiling, wide and empty, his blood pooling around him, staining his tawny locks, paling his skin— No. He couldn’t think of it again. Couldn’t think of the way John called his name behind the other students, trying to reach out, trying to protect him from the trick; how his hands had shaken, how he had stammered out the counter spell, how he had pushed his way back to John’s side and stood in stoic silence, unreachable.)
He watched the young Gryffindor’s hand tremble as he held his wand to his chest in a death grip. John seemed to be choking on breath, trying to contain the tears glistening in his eyes. He looked physically ill, unsteady and ready to be knocked over by a mere breath. Sherlock knew the other students were muttering about themselves in judgment. He didn’t care to hear their words himself, but he knew John would (and more importantly, he hated to see John lose himself), so he stepped forward, ignoring the rule not to intervene, and gingerly reached to touch John’s shoulders.
A tiny yelp escaped the boy, who flinched greatly under the touch which burned him. John turned away from the boggart to look at the offender. Sherlock’s eyes met John’s, damp and overflowing, and in his friend’s gaze he saw confusion and fear. John looked back to the boggart, blinked hard and gazed his way again, then returned to the trick before him, whimpering and entirely unsure which was reality and which was fraud.
"Come on, John," Sherlock said quietly, supportingly, in the way John would encourage him. "’Riddikulus’. It isn’t real.” A sharp breath shook the Gryffindor’s entire frame, and Sherlock saw tracks of tears beginning to trickle down his cheeks. His hands gripped John tighter, hoping the grip would bring him back to reality.
"I-I can’t," John choked at last, his horrified eyed not on his friend but on the boggart at his feet (at the picture of Sherlock’s still body soaked with blood, lifeless, no more brilliant charms or incantations slipping from his lips, no light in his eyes, no more Sherlock Holmes). John shook his head feverishly. “I can’t," he squeaked, and a desperate sob escaped him as he said again, “I can’t.”
With a glance to the professor and a nod of approval received, Sherlock tugged John aside - and he fought against him, uttering ‘No, no’, desperate to stay by his corpse’s side - without waiting for the professor to intervene with their own boggart, with their own jestful spell, with their own solution. He grabbed his and John’s bags and left the building, ignoring the hushed murmurs of their peers as they passed.
There is a secret room in Hogwarts that not many people know about. It burned the last time it was used, but Sherlock knew how to find it. He had read about it, had heard rumours, and now he and John were masters of summoning the Room of Requirement. And there they found themselves again and once more; and within the walls of the secret hideaway, John screamed at Sherlock, screamed at him what it was he saw as if Sherlock hadn’t seen as well; and within the walls John broke, falling to his knees, his hands on his eyes in anguish, sobbing out apologies that Sherlock was sure involved the illusion of his death; and within the walls Sherlock let John in, holding his frame and trying to soothe the distraught boy as best he could.
And he didn’t judge John at all, for he was the stronger of the two in Sherlock’s mind. He was the one who could let himself cry at the thought of his best friend dying. He was the one who cried for them both.
"It’s fine, John," Sherlock murmured, his cheek in John’s hair. “It’s all fine."
He pretended not to notice the fingers wrapped around his wrist, counting his pulse, each pump of blood bringing them both back to life.