This verse, "A man or a woman who has a ghost or a familiar spirit shall be put to death; they shall be pelted with stones—their bloodguilt shall be upon them," is the last verse of the chapter. However, it appears to be in the wrong place. This verse should be much earlier in the chapter, specifically after verse 6 ("And if any person turns to ghosts and familiar spirits..."). In addition, the chapter has logically ended with the previous verse ("You shall be holy to Me, for I the Lord am holy...").
Vs 6 says not to talk to the mystics (without addressing being a mystic); the rest of the chapter lists other crimes against God that separate persons from God, and whose crimes threaten the sanctity of the nation if the persons aren't removed from the nation. Vs 26 is the "refrain" command to be separated from the world and holy to God. So vs 27 then seems to underscore that the mystics themselves (already outside the realm of holiness because of the demonic-and-proud-of-it thing) should, if dying, be left to die.
I think it makes better sense in the Vulgate than the other texts, so Vulgate in English, Lev 20:27:
A man or woman in whom there is a pythonical or divining spirit, dying let them die. They shall stone them. Their blood be upon them.
Leviticus 20:27 - Why is this verse at the end of the chapter?
It would appear to be a means of emphasis after all that had preceded it.
- Verses 1-6 address Israel as a nation in dealing with those who offer children to Molech.
- Verses 7 and 8 deal with national sanctification.
Verses 9-21 deal with personal sins and how they are to be dealt with—
a. Verses 9-16 deal with those offenses that required the death penalty
b. Verses 17-21 touch on offenses that do not require the death penalty but to be "cut off" instead.
Verses 22-26 are another call to sanctification.
- Verse 27 is a staunch reminder that Israel is to be sanctified from the other nations and that especially included those who consulted demons. Those who committed such practices were not to be merely "cut off," but were to be put to death.