Then the question is, why would dilithium or latinum be exempted from atomic assembly in this manner?
It could be that they are just too complicated for replicators to handle, for whatever reason, in the 2370's. They might solve a lot of those problems in the future.
Or it could be that the replicators on a ship (or space station) are not good, or powerful, enough for it. Perhaps those industrial replicators can handle the more complicated stuff.
Also, those particular items have different issues (probably). We don't know enough about latinum to say what it is that could be an issue. Could be that it's some funky new element, or a particular funky compound of funky isotopes, which wouldn't necessarily be found in your typical replicator's supply of stock material. Dilithium crystals need to be energized a certain way to be effective, and perhaps the replicators for whatever reason can't do that. (It could also be that money-grade latinum needs to be energized in a similar way, which the replicator can't replicate.)