If it requires rare materials, ones that cannot be easily replicated (and we know they exist in the Trek universe), then there will be limits as to how many can be produced.
Or if specialist equipment is needed. Converting a photon torpedo production line into one for quantum torpedoes might require a great deal of time and effort.
And it makes military sense to stockpile the newer, more effective weapon for when it is needed. If a situation developed, another Borg attack for example, it would be useful to have the quantorps where the fleet could get at them. Having them all on ships at the edges of the Federation might mean they couldn't get to the crises zone in time.
That and what makes more sense, having a couple ships fully stocked or having a limited number on several ships.