Sahih Muslim 6776
The Book of Knowledge
حَدَّثَنَا أَبُو كَامِلٍ، فُضَيْلُ بْنُ حُسَيْنٍ الْجَحْدَرِيُّ حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، حَدَّثَنَا أَبُو عِمْرَانَ الْجَوْنِيُّ قَالَ كَتَبَ إِلَىَّ عَبْدُ اللَّهِ بْنُ رَبَاحٍ الأَنْصَارِيُّ أَنَّ عَبْدَ اللَّهِ بْنَ عَمْرٍو قَالَ هَجَّرْتُ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم يَوْمًا - قَالَ - فَسَمِعَ أَصْوَاتَ رَجُلَيْنِ اخْتَلَفَا فِي آيَةٍ فَخَرَجَ عَلَيْنَا رَسُولُ اللَّهِ صلى الله عليه وسلم يُعْرَفُ فِي وَجْهِهِ الْغَضَبُ فَقَالَ " إِنَّمَا هَلَكَ مَنْ كَانَ قَبْلَكُمْ بِاخْتِلاَفِهِمْ فِي الْكِتَابِ " .
Abdullah b. 'Umar reported:I went to Allah's Messenger (ﷺ) in the morning and he heard the voice of two persons who had an argumentation with each other about a verse. Allah's Apostle (ﷺ) came to us (and) the (signs) of anger could be seen on his face. He said: Verily, the (peoples) before you were ruined because of their disputation in the Book
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.