In every aspect of writing, consistency matters. Spelling, voice, laws of physics, actions of characters, all of these need to be consistent. If you start randomly changing any of those, you are going to leave your audience scratching their head. They will spend more time trying to understand what happened or why than appreciating your story.
Of course, nothing is a steadfast rule. Sometimes being inconsistent can be of great benefit. A narrator may want a consistent voice, but if all the characters sound the same, you sound stale. A random occurrence that seems to defy the rules of your world could pique curiosity. It could indicate that there is far more than we assume to reality.
I do believe that one should strive for consistency in most things for most of the time. It will make you a clearer and more effective writer. Inconsistency is its own art and its own style. But when you think it is the right thing to do, don't be afraid to experiment with it.