I've already asked one question about where Rashi got a particularly troubling interpretation of an obscure reference in the Gemara, telling a very detailed and gruesome story about R' Meir and his wife Beruriah.
In another instance (Bab. Sanhedrin 39a) Rashi expands in great detail upon a vague reference in the Gemara in which R' Yohanan says he knows of only three of the 300 parables about foxes taught by R' Meir to expound on Pesukim. R"Y gives a very short list, referring to the lessons by key phrases in their associated verses, and then Rashi tells us the story R"Y is referring to. But he doesn't just tell us a name for the story ("The Fox, the Wolf, and the Well") or give a watered down version of it ("A fox tricks a wolf into a well by showing him the moon's reflection down there and telling him it's cheese"). No. Rashi, who usually writes very curtly about simple concepts to aid the reader in understanding the basic meaning of a passage in the Gemara, goes into full-on story-teller mode, for 4 long lines and 10+ short lines, using almost 1/4 of the real estate on the "Rashi side" of the printed Vilna edition of the Gemara.
Where do these amazing stories come from in Rashi? Does he have a source? Were they taught orally by his teacher's teacher's teacher's teacher's teacher (however many times), dating all the way back to R' Meir? Are they (usually, generally, occasionally??) recorded elsewhere in works that are traceable/accountable?