Okay, my speculation(s) as to why this is in Voltaire's memoirs but not yet in the 1752 anonymous pamphlet. Aren't mutually exclusive but don't have to be true all at once.
1.) Difference in circumstance of writing. Voltaire wrote the pamphlet as part of his escalating pamphlet war with Fritz, but the book burning and the Frankfurt arrest had not happened yet, so he wasn't yet ready to go fully scorched earth. The memoirs he knew would get published once he was dead, so no problem there. This speculation assumes that the rumor already existed in 1752. However, it could also be that:
2.) There was no rumor, but Voltaire had several decades to think of something even more schoolboy taunt than "totally gay", to wit "gay but unable to penetrate because of badly treated STD! Totally bottoming!" for the memoirs, whereas in 1752 he was in something of a hurry.
3.) Difference in circumstance for Fritz. By 1752, it was very clear to all and sunder that his married life was non-existent, and that any favourites of his were more likely to be of the male persuasion. However not exclusively so: the grand finale of the Barbarina saga wasn't that long ago, and if I was a contemporary with limited-by-rumor-and-some-pamphlets access to information, you bet I'd have assumed the King and the ballerina he was willing to pay that much money for and threw such a fit about (twice) had had a sexual affair. And even better informed circles - like, say, all those ambassadors paying for information - in their reports mentioning handsome men (whether Fredersdorf or the odd husar) - definitely don't consider Fritz wa keeping those guys just to look at. Consider, too, that Fritz wasn't yet living the full hermit life he would post 7 Years War. He'd dumped most of the court obligations on EC and his brothers, but he did participate in the carnival each year, and on some other occasions, too. He wasn't yet seen as completely different from all the other monarchs. And the default assumption for an 18th century monarch is that they have a lot of sex. Then there's the fact that 1752 Fritz is still basking in the Undefeated Conqueror image of Militant Masculinity. So, gossip mongers weren't likely to hit on the idea that he had sex problems resulting in either bottoming or impotence. However, by the 1770s or whenever Voltaire was writing his Fritzian memoirs (I like to think he kept going back to the manuscript and adding another dig through the decades), things were different. No more ballerinas (with favoured singers like Schmeling Mara, no one assumed Fritz was interested in her romantically at all), and not really male favourites to gossip about, either. Fritz had aged before his time through the war and was hardly seen in public anymore at all, save for the military revues and the occasional guest of state. And while he was admired as the genius who fought all of Europe to a stand still for seven years, the perception of him as invulnerable was gone. All this makes gossip of him bottoming and/or having long term STD caused problems far more easy to buy in the public perception.
4.) Dark horse possibility: not only was there a rumor but it was based on some factual stuff, but Voltaire didn't learn about it while he was still in Prussia. Because while he was still in Prussia, possible sources weren't suicidal, knowing Voltaire could just as well turn on them and either by intent or carelessness let the King know what they said. Now you'd think once he's settled down in Geneva, he'd have had less, not more access to spicy Prussian court gossip. HOWEVER. There's Doctor Theodore Tronchin. Who was treating Voltaire in Geneva while also making trips to Prussia. Which he even did during the war. He was the one to certify Ferdinand as REALLY REALLY ILL. I.e. he did treat members of the royal family (don't know whether he ever treated Fritz personally, but it's not impossible), and presumably hung out with what doctors were there when visiting Berlin. And in terms of his ethics, Tronchin is the one providing a lot of gossip about Voltaire's final weeks of life, of which he only witnessed a bit. So I wouldn't put it beyond him to have shared such a story with Voltaire, had he come across it one way or the other.
ETA: Almost forgot this: what also might factor in Voltaire either inventing or spreading the rumor: Fritz himself evidently thought it was the height of hilarity to accuse someone of having STD. Not just young Marwitz, but Louis XV. in one of the satiric poems Voltaire absconded with that got him arrested in Frankfurt. I also seem to recall (maybe wrongly?) he mentioned Algarotti having some problems in this regard to someone else? And even the censored Volz translated version of the Palladion has some STD jokes. So: maybe Voltaire thought turnabout was just fair game?
Re: The STD thread
1.) Difference in circumstance of writing. Voltaire wrote the pamphlet as part of his escalating pamphlet war with Fritz, but the book burning and the Frankfurt arrest had not happened yet, so he wasn't yet ready to go fully scorched earth. The memoirs he knew would get published once he was dead, so no problem there. This speculation assumes that the rumor already existed in 1752. However, it could also be that:
2.) There was no rumor, but Voltaire had several decades to think of something even more schoolboy taunt than "totally gay", to wit "gay but unable to penetrate because of badly treated STD! Totally bottoming!" for the memoirs, whereas in 1752 he was in something of a hurry.
3.) Difference in circumstance for Fritz. By 1752, it was very clear to all and sunder that his married life was non-existent, and that any favourites of his were more likely to be of the male persuasion. However not exclusively so: the grand finale of the Barbarina saga wasn't that long ago, and if I was a contemporary with limited-by-rumor-and-some-pamphlets access to information, you bet I'd have assumed the King and the ballerina he was willing to pay that much money for and threw such a fit about (twice) had had a sexual affair. And even better informed circles - like, say, all those ambassadors paying for information - in their reports mentioning handsome men (whether Fredersdorf or the odd husar) - definitely don't consider Fritz wa keeping those guys just to look at. Consider, too, that Fritz wasn't yet living the full hermit life he would post 7 Years War. He'd dumped most of the court obligations on EC and his brothers, but he did participate in the carnival each year, and on some other occasions, too. He wasn't yet seen as completely different from all the other monarchs. And the default assumption for an 18th century monarch is that they have a lot of sex. Then there's the fact that 1752 Fritz is still basking in the Undefeated Conqueror image of Militant Masculinity. So, gossip mongers weren't likely to hit on the idea that he had sex problems resulting in either bottoming or impotence.
However, by the 1770s or whenever Voltaire was writing his Fritzian memoirs (I like to think he kept going back to the manuscript and adding another dig through the decades), things were different. No more ballerinas (with favoured singers like Schmeling Mara, no one assumed Fritz was interested in her romantically at all), and not really male favourites to gossip about, either. Fritz had aged before his time through the war and was hardly seen in public anymore at all, save for the military revues and the occasional guest of state. And while he was admired as the genius who fought all of Europe to a stand still for seven years, the perception of him as invulnerable was gone. All this makes gossip of him bottoming and/or having long term STD caused problems far more easy to buy in the public perception.
4.) Dark horse possibility: not only was there a rumor but it was based on some factual stuff, but Voltaire didn't learn about it while he was still in Prussia. Because while he was still in Prussia, possible sources weren't suicidal, knowing Voltaire could just as well turn on them and either by intent or carelessness let the King know what they said. Now you'd think once he's settled down in Geneva, he'd have had less, not more access to spicy Prussian court gossip. HOWEVER. There's Doctor Theodore Tronchin. Who was treating Voltaire in Geneva while also making trips to Prussia. Which he even did during the war. He was the one to certify Ferdinand as REALLY REALLY ILL. I.e. he did treat members of the royal family (don't know whether he ever treated Fritz personally, but it's not impossible), and presumably hung out with what doctors were there when visiting Berlin. And in terms of his ethics, Tronchin is the one providing a lot of gossip about Voltaire's final weeks of life, of which he only witnessed a bit. So I wouldn't put it beyond him to have shared such a story with Voltaire, had he come across it one way or the other.
ETA: Almost forgot this: what also might factor in Voltaire either inventing or spreading the rumor: Fritz himself evidently thought it was the height of hilarity to accuse someone of having STD. Not just young Marwitz, but Louis XV. in one of the satiric poems Voltaire absconded with that got him arrested in Frankfurt. I also seem to recall (maybe wrongly?) he mentioned Algarotti having some problems in this regard to someone else? And even the censored Volz translated version of the Palladion has some STD jokes. So: maybe Voltaire thought turnabout was just fair game?