The Punishment for Marrying a Mahram in Islamic Law
The specific hadith about the punishment of a man who marries one of his maharim has weakness due to iḍṭirāb in the narration. This was pointed out by al-Arnāʾūṭ in his taḥqīq of Sunan Abī Dāwūd.

This scan is fromSunan Abī Dāwūd with the taḥqīq of al-Arnāʾūṭ, volume 5, page 505, footnote no. 1, under hadith no. 4457. The note points out weakness in the narration due to iḍṭirāb, meaning inconsistency or instability in how the hadith is transmitted. This weakens the specific narration as proof for a fixed prescribed punishment based on this report alone.
Iḍṭirāb refers to instability or inconsistency in a narration where the reports differ in a way that cannot be reconciled or preferred with confidence. When this occurs in a significant part of the chain or text, it can weaken the hadith.
However, this does not mean that marrying a mahram is treated as a minor matter in Islamic law. The act remains a grave violation, and many scholars held that the person who knowingly does this is to be punished.
The weak point is the specific hadith as a standalone proof, not the legal seriousness of the act itself. A weak narration does not automatically mean the ruling has no basis, because jurists may establish punishment through broader legal principles, other evidences, and the severity of the crime.
So the correct answer is: the specific hadith is weak due to iḍṭirāb, as noted by al-Arnāʾūṭ, but the broader fiqh position remains that a person who knowingly marries his mahram is liable to severe legal punishment according to many scholars.