Is there a written source for this story? I looked up the hadith and just found one where it says "yeah I saw the prophet shitting and he was looking away from the Kaaba" (I guess as if to say that it's better for a Muslim to shit with their back to the Kaaba's direction instead of towards it, maybe?)