Bulugh al-Maram 94
وَعَنْ جَابِرٍ - رضي الله عنه - قَالَ: قَالَ رَسُولُ اللَّهِ - صلى الله عليه وسلم: «إِذَا تَغَوَّطَ الرَّجُلَانِ فَلْيَتَوَارَ كُلُّ وَاحِدٍ مِنْهُمَا عَنْ صَاحِبِهِ, وَلَا يَتَحَدَّثَا، فَإِنَّ اللَّهَ يَمْقُتُ عَلَى ذَلِكَ». رَوَاهُ. وَصَحَّحَهُ ابْنُ السَّكَنِ, وَابْنُ الْقَطَّانِ, وَهُوَ مَعْلُولٌ.
From Jabir, may Allah be pleased with him, who said: The Messenger of Allah ﷺ said: "When two men relieve themselves, let each of them hide from the other, and let them not talk, for Allah detests that." It was narrated, and Ibn as-Sakan and Ibn al-Qattan graded it sahih, but it has a hidden defect.