i dont remember the storyline exactly but there were three people, one lent money to another and one of them got killed and then the other one came and took the second one's money. Moshe rabbeinu asked hashem what was going on and hashem showed him that in a previous life he owed him money etc.
I'm not sure if this is quite what you are looking for, but the Talmud discusses Moshe's question about bad things happening to good people (and vice versa).
וא"ר יוחנן משום ר' יוסי שלשה דברים בקש משה מלפני הקב"ה ונתן לו בקש שתשרה שכינה על ישראל ונתן לו שנאמר הלוא בלכתך עמנו בקש שלא תשרה שכינה על עובדי כוכבים ונתן לו שנאמר ונפלינו אני ועמך בקש להודיעו דרכיו של הקב"ה ונתן לו שנא' הודיעני נא את דרכיך אמר לפניו רבש"ע מפני מה יש צדיק וטוב לו ויש צדיק ורע לו יש רשע וטוב לו ויש רשע ורע לו אמר לו משה צדיק וטוב לו צדיק בן צדיק צדיק ורע לו צדיק בן רשע רשע וטוב לו רשע בן צדיק רשע ורע לו רשע בן רשע: אמר מר צדיק וטוב לו צדיק בן צדיק צדיק ורע לו צדיק בן רשע איני והא כתיב פקד עון אבות על בנים וכתיב ובנים לא יומתו על אבות ורמינן קראי אהדדי ומשנינן לא קשיא הא כשאוחזין מעשה אבותיהם בידיהם הא כשאין אוחזין מעשה אבותיהם בידיהם אלא הכי קא"ל צדיק וטוב לו צדיק גמור צדיק ורע לו צדיק שאינו גמור רשע וטוב לו רשע שאינו גמור רשע ורע לו רשע גמור ופליגא דר' מאיר דא"ר מאיר שתים נתנו לו ואחת לא נתנו לו שנא' וחנתי את אשר אחון אע"פ שאינו הגון ורחמתי את אשר ארחם אע"פ שאינו הגון
R. Johanan further said in the name of R. Jose: Three things did Moses ask of the Holy One, blessed be He, and they were granted to him. He asked that the Divine Presence should rest upon Israel, and it was granted to him. For it is said: Is it not in that Thou goest with us [so that we are distinguished, I and Thy people, from all the people that are upon the face of the earth]. He asked that the Divine Presence should not rest upon the idolaters, and it was granted to him. For it is said: ‘So that we are distinguished, I and Thy people’. He asked that He should show him the ways of the Holy One, blessed be He, and it was granted to him. For it is said: Show me now Thy ways. Moses said before Him: Lord of the Universe, why is it that some righteous men prosper and others are in adversity, some wicked men prosper and others are in adversity? He replied to him: Moses, the righteous man who prospers is the righteous man the son of a righteous man; the righteous man who is in adversity is a righteous man the son of a wicked man. The wicked man who prospers is a wicked man son of a righteous man; the wicked man who is in adversity is a wicked man son of a wicked man.
The Master said above: ‘The righteous man who prospers is a righteous man son of a righteous man; the righteous man who is in adversity is a righteous man son of a wicked man’. But this is not so! For, lo, one verse says: Visiting the iniquity of the fathers upon the children, and another verse says: Neither shall the children be put to death for the fathers. And a contradiction was pointed out between these two verses, and the answer was given that there is no contradiction. The one verse deals with children who continue in the same course as their fathers, and the other verse with children who do not continue in the course of their fathers! — [You must] therefore [say that] the Lord said thus to Moses: A righteous man who prospers is a perfectly righteous man; the righteous man who is in adversity is not a perfectly righteous man. The wicked man who prospers is not a perfectly wicked man; the wicked man who is in adversity is a perfectly wicked man. Now this [saying of R. Johanan] is in opposition to the saying of R. Meir. For R. Meir said: only two [requests] were granted to him, and one was not granted to him. For it is said: And I will be gracious to whom I will be gracious, although he may not deserve it, And I will show mercy on whom I will show mercy, although he may not deserve it. (Soncino translation)
The Talmud also alludes to (and it is fleshed out by Rashi) another instance of Moshe questioning God's allowing bad things to happen to innocent people, and God responded by allowing Moshe to see that the people would end up being wicked.
תנא הוא נבט הוא מיכה הוא שבע בן בכרי נבט שניבט ולא ראה מיכה שנתמכמך בבנין ומה שמו שבע בן בכרי שמו
A Tanna taught: Nebat, Micah, and Sheba the son of Bichri are one and the same. [He was called] Nebat, because ‘he beheld but did not see’; Micah, because ‘he was crushed in the building’; and what was his real name? — Sheba the son of Bichri. (Soncino translation)
נתמכמך בבנין. של מצרים שנתנוהו בבנין במקום לבנה כדמפרש באגדה שאמר לו משה להקב"ה אתה הרעות לעם הזה שעכשיו אם אין להם לבנים משימין בניהם של ישראל בבנין אמר לו הקב"ה קוצים הם מכלין שגלוי לפני אילו הם חיים היו רשעים [גמורים] ואם תרצה תנסה והוציא אחד מהן הלך והוציא את מיכה
And there is another tale of Moshe's complaining about the suffering of the innocent.
The cruel suffering to which his people was exposed caused Moses to speak to God thus: "I have read the book of Genesis through, and I found the doom in it pronounced upon the generation of the deluge. It was a just judgment. I found also the punishments decreed against the generation of the confusion of tongues, and against the inhabitants of Sodom. These, too, were just. But what hath this nation of Israel done unto Thee, that it is oppressed more than any other nation in history? Is it because Abraham said, 'Whereby shall I know that I shall inherit the land?' and Thou didst rebuke him for his small faith, saying, 'Know of a surety that thy seed shall be a stranger in a land that is not theirs'? Why, then, are not the descendants of Esau and Ishmael held in bondage, too? Are they not likewise of the seed of Abraham? But if Thou wilt say, 'What concern is it of mine?' then I ask Thee, Why didst Thou send me hither as Thy messenger? Thy great, exalted, and terrible Name is feared in all the earth, yet Pharaoh heard me pronounce it, and he refuses obedience. I know Thou wilt redeem Israel in Thine own good time, and it is of little moment to Thee that now they are immuring living Israelites in these buildings."
Were He a God of justice only, the Lord would have slain Moses for the audacity of his last words, but in view of his having spoken as he had only out of compassion with Israel, the Lord dealt graciously with him. He answered Moses, saying, "Thou shalt see what I will do to Pharaoh," words conveying to Moses, that although he would be witness to the chastisement of Pharaoh, he would not be present at that of the thirty-one kings of Canaan. Thus he was rebuked for the unbecoming language he had used in addressing God. At the same time God's words were a rejoinder to another speech by Moses. He had said: "O Lord of the world, I know well that Thou wilt bring Thy children forth from Egypt. O that Thou wouldst make use of another instrument, for I am not worthy of being the redeemer of Thy children." God made answer thereto: "Yes, Moses, thou art worthy thereof. Through thee My children will be brought forth out of Egypt. Thou shalt see what I will do to Pharaoh."