The Prophet ﷺ said, "A man should not lie skin-to-skin with another man, nor a woman with another woman."
حدثنا خلف بن الوليد حدثنا إسرائيل عن سماك عن عكرمة
قال النبي ﷺ لا يباشر الرجل الرجل ولا المرأة المرأة
Its isnad is sahih, and it is found in Majma al-Zawaid 8:102, where he said, Ahmad, Bazzar, and Tabarani in al-Saghir narrated it, and one of Ahmad's two isnads has narrators who are the narrators of the Sahih, and likewise the narrators of Bazzar, and it will come again at 2873 with a sahih isnad, and at 2874 with a mursal isnad, and that is the other one to which the author of al-Zawaid refers.