Writers don't "have to maintain canon." That's getting it backward. What the writers create is the canon, by definition. It's not some set of rules forced on us by whatever higher authority you're imagining. The creator of a fictional universe is the highest authority. A canon is just a set of stories that have something in common, and stories are just pretend, so they can change their specifics and pretend it always worked that way -- like James R. Kirk becoming James T., or Data using contractions regularly until suddenly he couldn't, or the 24th-century Federation being portrayed as utterly peaceful in seasons 1-2 until season 4 retconned in a recently-ended Cardassian war.
You're making the common mistake of assuming that "canon" means "continuity." Yes, it's preferable to maintain as much continuity as feasible for the sake of credibility, but continuity is a means to the end of telling stories, not the other way around. All creativity is a process of trial, error, revision, and rethinking, because no human achievement is perfect the first time out, and there's always room for more improvement. Ideally, you want the revision and change to happen before release, but any ongoing series is inevitably going to require some revisions along the way. A canon is something that pretends to have a uniform continuity even when it changes the details -- like, say, the Marvel Comics canon pretending that every story from 1961 to the present has taken place within the past 10-15 years, constantly altering the period specifics (for instance, Reed Richards is no longer a WWII veteran and Flash Thompson no longer fought in Vietnam) while pretending it's all still a single unified continuity. Continuity, like everything else in fiction, is an illusion, a pretense. The audience is expected to play along with the illusion, to suspend disbelief for the sake of the story. Continuity is not a straitjacket. It's not the overriding purpose of storytelling. It's just a story device, to be used or set aside as needed.
That doesn't change the fact that Star Trek has routinely portrayed dilithium crystals as a resource that can be quickly depleted and require regular replacement, going back to the introduction of the crystals (as "lithium crystals") in "Mudd's Women." I don't see the point of trying to argue that something explicitly and consistently depicted in canon is somehow not actually the case.