One of the things that is so compelling about the Old Testament is how multivocal it is, different sensibilities that create contrasts and tensions.
For example, we have the story in 2 Samuel 6 of Uzzah who died because he reached up to steady the Ark of the Covenant as it made its way to Jerusalem. The story seems to share the view that even the slightest deviation from God's commands can bring about disastrous consequences.
But contrasting with the fate of of Uzzah, is the story from 2 Chronicles 30 related to king Hezekiah's religious reforms.
One of the things that Hezekiah restores is the celebration of the Passover, calling all Israel and Judah back to the forgotten and forsaken ritual. Because of their collective ignorance, many of the people who come to the Passover are not in a state of ritual purity. Knowing this, Hezekiah petitions God for grace for this failure:
There were many in the assembly who had not consecrated themselves. Therefore the Levites had to slaughter the Passover lamb for everyone who was not clean, to consecrate it to the Lord. For a majority of the people, many of them from Ephraim, Manasseh, Issachar, and Zebulun, had not cleansed themselves, yet they ate the Passover otherwise than as prescribed. For Hezekiah had prayed for them, saying, “May the good Lord pardon everyone who sets his heart to seek God, the Lord, the God of his fathers, even though not according to the sanctuary's rules of cleanness.” And the Lord heard Hezekiah and healed the people.
Because of their pure hearts and motivations, their desire to please God, the people were healed, even though they were breaking the rules. It's a story that pushes back on a too-easy takeaway message from the case of Uzzah. Rules can be bent. Grace can be found, even within the ritual purity codes.