Can you imagine being the Mayfly Man at that wedding reception, though? He must have felt like the most brilliant human on earth. Sherlock’s toast referenced several cases, but the two major ones, the ones Sherlock could not solve, were both committed by the Mayfly Man.
When the bloody guardsman story starts, he experiences a moment of panic at the sound of his crime retold right in front of him, but when he realizes that there is no ulterior motive (yet) to the rambling toast, he feels a rush of relief and pride. Sherlock admits that he “didn’t solve that one,” and then goes on to tell the story of the the woman, and subsequently women, dating a ghost - the Mayfly Man has another burst of panic (”surely they’re on to me, I’m right here in the bloody room!”), but again it is clear that this story revolves more around the Sherlock-and-John aspect of the story than the actual case that arrived after the stag night.
Then a glorious realization dawns on the Mayfly Man: not only has he managed to stump the brilliant and world-renowned Sherlock Holmes twice, but he’s about to do it again. Perhaps Sherlock will connect the dots this time, but by then Major Sholto will be dead and he will be long gone and again victorious.
Goes to show how much pride clouds one’s judgement - when NSY contacts him and asks him to come back to the venue, he obliges like an utter fool because he’s so sure of his brilliance. Idiot.