Parashas Bamidbar · Passuk 1:51
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.
Chabad.org — English translation + Rashi
Source: Bamidbar Rabbah 1:12.
English: “And the stranger who approaches shall die” — \ldots even regarding David king of Israel.
In context: The prohibition on unauthorized approach to the Mishkan is absolute; the midrash underscores that no rank exempts one from the boundary.
Custom
Chazal teach that the death penalty for approaching the sacred space applies without exception of status.