In Leviticus 24:11-23 we have a case inserted within a legal dialogue. The Son of a foreign man and an Israelite woman profaned God's Name and (it seems that because of His status as a foreigner) they didn't know what's to do with him. So God gave a ruling through Moses that the same law applies to Israelite and non-Israelite who dwelled in the land (v22).
Why was the death penalty prescribed for taking God's Name in vain? And, why does it seem that no offer of atonement was extended to this foreigner?
"and the Israelite woman's son blasphemed the Name, and cursed. ...His mother's name was Shelomith, the daughter of Dibri, of the tribe of Dan."
V. 22 applies the penalty for murder or a person or livestock to the foreigner, but has nothing to do with cursing/blasphemy.