The Messenger of Allah ﷺ said, "A man should not lie skin to skin with another man, nor a woman with another woman."
حدثنا عبد الرزاق وخلف بن الوليد قالا حدثنا إسرائيل عن سماك عن عكرمة
قال رسول الله ﷺ لا يباشر الرجل الرجل ولا المرأة المرأة
Its isnad is sahih. It is a repetition of 2774.