I mean, supposedly, Voyager only had (I think) 53 Photon torpedoes when it arrived in the Delta Quadrant, and they made it sound like they couldn't replace them, even with replicator technology on the ship.
But the ship did not have replicator technology - that was the point. When Janeway said that there were 38 torps aboard, and no way to replace them when they were gone, the ship was still suffering from the damage she had received when the Caretaker transported her to the Delta Quadrant.
Later in the show, the ship had access to the port facilities of cultures far more advanced than those dominating the Kazon lands. Supposedly, the replicators started working just fine, too. Janeway still kept the "replicator rations" as a disciplinary measure for some time, but it makes sense that the ship would gradually grow more self-sufficient again.
They're unable to replicate some component to the torpedo.
In DS9 "Tribunal", it was considered plausible that the Maquis would want to steal empty photon torpedo warheads, even though we have every reason to think the Maquis would have access to at least food replicators. Supposedly, then, the warheads would be non-trivial to manufacture.
Granted, the Maquis would later go and steal industrial-grade replicators in "For the Cause", suggesting their logistical situation before the theft might have differed from that of Starfleet, which supposedly enjoys regular access to such technology.
As for replicated food being inferior to "real", I think it's just empty talk. We never see a character recognize a food for replicated by the taste, after all.