Parashas Bamidbar
וּבִנְסֹ֣עַ הַמִּשְׁכָּ֗ן יוֹרִ֤ידוּ אֹתוֹ֙ הַלְוִיִּ֔ם וּבַחֲנֹת֙ הַמִּשְׁכָּ֔ן יָקִ֥ימוּ אֹת֖וֹ הַלְוִיִּ֑ם וְהַזָּ֥ר הַקָּרֵ֖ב יוּמָֽת׃
When the Tabernacle is to set out, the Levites shall take it down, and when the Tabernacle is to be pitched, the Levites shall set it up; any outsider who encroaches shall be put to death.
Torah Temimah points to TT / Sanhedrin / related aggadah (verified).
והזר הקרב יומת —\ldots אפילו על דוד מלך ישראל.
English: “And the stranger who approaches shall die” — \ldots even regarding David king of Israel.
Custom
Chazal teach that the death penalty for approaching the sacred space applies without exception of status.