Is there any scriptural basis to this story of Sri Krishna, Yudhishtira and the bitter gourd?
The story goes like this:
After the Mahabharata war, King Yudhishtira and his brothers decide to go on a pilgrimage to cleanse themselves of sins committed during the war. Yudhishtira requests Sri Krishna to accompany them on their voyage. Krishna obliges but instead of accompanying himself, sends a bitter gourd in his place, telling Yudhishtira to treat the bitter gourd as (Krishna) himself, dip it in the holy waters and bring it back to him.
Yudhishtira doesn't question or doubt Krishna's reasons and does as advised. He dips the bitter melon in the sacred waters at all holy places he visits and brings it back to Krishna. Krishna then cuts the bitter melon and serves it to all the Pandavas and asks them to eat it. The Pandavas don't seem too happy chewing it down their throats as the gourd was still bitter. They complain. Krishna then offers them some wisdom, that just as the bitter gourd took dips in holy water and still remained bitter as ever, so do your sins. It's a mere whim that you can wash away your sins by going on a pilgrimage or immersing in holy water.
Moral of the story:
You cannot wash away your sins by simply dipping yourself in river Ganga or any sacred waters.