II Samuel 6:7

וַיִּחַר אַף ה’ בְּעֻזָּה וַיַּכֵּהוּ שָׁם הָאֱלֹקים עַל הַשַּׁל וַיָּמָת שָׁם עִם אֲרוֹן הָאֱלֹקים

The anger of Hashem was kindled against Uzzah and G-d struck him there for his error; there he died by the ark of G-d.

The Radak explains that the error was that the aron was meant to be carried by members of the Tribe of Levi, not transported by wagon; this is why tragedy occurred. (Yes, the Philistines returned the aron by wagon without incident in I Samuel chapter 6, but they weren’t expected to know this law; King David certainly was.)