In the book of Jeremiah Israel is under the beilef that as long as they do their rituals in the temple and keep the Sabbath holy, God will always be in their favor despite their other behaviours.
It’s a similar mentality to the Ark of the Covenant. Isreal beileved the Ark itself had power and in some ways thought they could control God with it.
In a similar way, I can go to church every Sunday, say my prayers, and read the bible but if I am not living out of love, gratitude and grace, God wouldn’t have a problem letting me fall to my own selfishness.
James 4:6 says “but he gives us more grace. That is why Scripture says: “God opposes the proud but shows favor to the humble.”
I don’t always treat people the way I am commanded to by Christ but an aligned heart that is full of remorse and repentance is always welcomed over the heart that beileves it is always right.
We all stray in our spiritual direction, whether intentional or not. Our God is here to correct and comfort us along side our spiritual community.