The potential capabilities of Star Trek manufacturing technologies aren't that difficult to assess. We don't have to speculate when we can simply listen to the characters speak.
In ENT, they told us how their food was (at least partially) manufactured from raw ingredients down to the protein level, but they also told us there were types of spares and materials they could not manufacture aboard no matter what. In TOS, they told us they can fabricate things like flintlocks or clothing or (at least certain kinds of) jewels but they also demonstrated they couldn't have dilithium or cooling pumps for old nuclear reactors whipped up that easily, if at all. In the TOS movies, they told us that making life out of lifelessness was a new and highly experimental arrow in their quiver. And in the VOY era, they told us that they can create life (or functioning neural tissue, at any rate) at the press of a button, but that they did not
have replicators in the TOS movie era yet.
We don't have any particular reason or authority to disbelieve them. We can only take what we see as absolute truth; what we hear as potentially modified truth; and what we infer as inconsequential and in all probability completely erroneous.
Regarding the idea of getting dilithium at the push of a button in TOS, that's flat out because our heroes say it is. Getting it at the push of a button in TNG, though... LaForge says to Scotty that pushing a particular button will keep existing dilithium going in ways that weren't available in the TOS movie era yet. But he says nothing about how new dilithium is obtained in his era.
Significantly, there isn't a single instance of canon Trek where a substance or structure would have been considered unreplicable per se. There are instances where it is considered impractical to replicate something - and there's "Night Terrors" where our heroes say they have lost the ability to synthesize elements, indicating they normally possess that ability. It would stand to reason, then, that dilithium could be replicated, at some unknown cost that the heroes may or may not be willing to pay. But none of this even remotely suggests that the TOS heroes would have had the option, too. And indeed the reference to them not having replicators heavily suggests that their manufacturing systems (by whatever name) left a lot to be desired in comparison with Janeway's - who, intriguingly enough, never ran into a dilithium shortage.