A sorcerer 'cuts off heads and restores them' at al-Walid's court; a Muslim beheads him: 'If he is truthful, let him bring himself back to life'
Magic & Occult Strange / Obscure Hudud Moderate al-Bayhaqi, al-Sunan al-Kubra 16502"He would strike a man's head, then shout at him, and the man would get up and his head would return to him. The people said: 'Glory be to Allah, he brings the dead to life!' ... The man drew his sword and struck his neck, and said: 'If he is truthful, let him bring himself back to life.'"
What the hadith says
Abu al-Aswad, a Successor, relates that a sorcerer used to perform before al-Walid b. Uqba in Iraq. He would strike a man's head, shout at him, and the man would rise with his head restored, and people exclaimed that he brought the dead to life. A righteous man of the Emigrants watched; the next day he came with his sword under his cloak, and when the sorcerer began his act he drew it and beheaded him. Al-Walid had him jailed, but the jailer, Dinar, a good man, admired him and let him escape: 'Go, Allah will never question me about you.' Al-Bayhaqi records this in al-Sunan al-Kubra 16502; the report just before it, 16501, names the killer as Jundub al-Bajali, who then recited Q 21:3, 'Will you go to sorcery while you see?' No grading of either report was found, and 16502 comes from a Successor, not an eyewitness. The saying 'the punishment of the sorcerer is a blow with the sword' is in Tirmidhi 1460, where al-Tirmidhi says the sound version is Jundub's own words.
Why this is a problem
The story itself treats the head trick as illusion: it is sorcery that fooled the crowd, and the killer's taunt rests on the sorcerer being unable to revive himself. So the man was killed not for murder or harm but for a performance at the governor's court. He was killed on the spot, by a private individual, without accusation, trial or any chance to repent, and the narrator calls the killer 'a righteous man of the Emigrants'.
The account takes the killer's side throughout. The governor jails him; the 'good' jailer frees him; and al-Bayhaqi places the story in the chapter 'Declaring the sorcerer an unbeliever and killing him if what he uses for sorcery is words of explicit unbelief', with the Jundub version beside it. A summary beheading in front of the authorities becomes a model of zeal, and releasing the killer is presented as piety.
The Muslim response
Muslims answer that the report is not a saying of the Prophet and that its chain does not reach a witness. The jurists also did not agree that every sorcerer is killed: al-Tirmidhi notes that Malik held this view, while al-Shafi'i said a sorcerer is killed only when his sorcery amounts to unbelief (Tirmidhi 1460). Al-Bayhaqi's full chapter title limits the killing to the case where 'what he uses for sorcery is words of explicit unbelief'.
Why it fails
The response is right that this is a Successor's story, ungraded, and not a word of the Prophet. But the death penalty for sorcery is not drawn from this story alone; al-Tirmidhi reports that some Companions and later scholars acted on it, and Malik applied it. Al-Shafi'i's limit narrows who is killed, not whether.
The story shows no inquiry into what the sorcerer used: no one asks whether his words were unbelief before the sword falls. Al-Bayhaqi nonetheless filed this vigilante killing as evidence for his chapter. The tradition kept the story as an example to follow, not as a warning.