The Messenger of Allah ﷺ would wake up in a state of major ritual impurity from intercourse, not from a wet dream, and then he would fast. In the narration of Abd Rabbih, she added the words, "during Ramadan."
حدثنا عبد الرحمن عن مالك عن سمي وعبد ربه بن سعيد عن أبي بكر بن عبد الرحمن
أن رسول الله ﷺ كان يصبح جنبا من جماع غير احتلام ثم يصوم وقالت في حديث عبد ربه في رمضان
Its isnad is sahih, its narrators are trustworthy and well-known. Sumayy is the freed slave of Abu Bakr bin Abdul-Rahman bin Harith bin Hisham, and the two of them are trustworthy, their hadiths appear in all the collections. Likewise Abd Rabbih bin Saeed. The hadith has already appeared at 23944.