The Messenger of Allah ﷺ said, "Adam and Musa met, and Musa said to Adam, 'Are you the one who brought misery upon mankind and caused their expulsion from Paradise?'Adam replied, 'Are you the one whom Allah chose for His message, selected for Himself, and to whom He revealed the Torah?'Musa said, 'Yes.'Adam asked, 'Did you find it written upon me before He created me?'Musa said, 'Yes.'So Adam outargued Musa."
عن رسول الله ﷺ قال: التقى آدم وموسى، فقال موسى لآدم: أنت الذي أشقيت الناس، وأخرجتهم من الجنة؟ قال له آدم: أنت الذي اصطفاك الله برسالته، واصطفاك لنفسه، وأنزل عليك التوراة؟ قال: نعم. قال: فوجدتها كتب علي قبل أن يخلقني، قال: نعم. فحج آدم موسى.
Bukhari narrated it in the tafsir (4736), and Muslim in the qadar (15:2652), both of them through Muhammad bin Sirin, from Abu Hurairah, who related it. The wording given is Bukhari's, for Muslim did not present his own wording with this chain, but rather referred back to the chain preceding it.