Maybe they didn't have the ability to replicate all of the components for a photon torpedo on say...day 47, but surely after 5 years, hundreds of planets, dozens of friendly, advanced civilizations, and all the experience of maintaining self sufficiency without Starfleet around, they could. They ran out of their initial supply of photon torpedoes sometime in season 5. By this point we've seen them: build the Delta Flyer(and we got to watch how it was built and where it was built), create alternative torpedoes, and trade with weapons dealers. And surely massive Starships aren't sent out on extended missions with only food replicators, or without spare parts. Ships would need these whether they're near Federation space or not.