There are three reasons why that trick worked, and Picard couldn't just "replicate" hundreds of machine guns.
1.) The holodeck did not create an actual machine gun for Picard, it just copied the look and effect. The "machine gun" did not fire actual bullets. The holodeck projected light, and various complicated energy fields to duplicate the effect of actual gunfire. Since it's something to which the Borg (tm) were not accustomed, it was effective.
2.) The computer database did not have actual machine gun blueprints (or ammo) that could be replicated (and even if it did, the only place which has replicators is the bar 10 forward, which was already assimilated at that point). Since the ship only contains Holo projectors in the holodeck, and med bay (for the Emergency Medical Hologram), these are the only two places on the ship where a "holo artillery barrage" could be set up.
3.) They are THE BORG. They quickly adapt to anything "new" or "different." The "machine gun" trick would have worked once, maybe twice before the Borg "personal shields" adapted and it became completely useless. I'm certain this would apply to REAL machine guns too. In fact, a remnant of these time traveling Borg awoke in the past on "Enterprise" and DID face machine gun fire, only to adapt and assimilate the SWAT team that was shooting at them.
1)Correct, but that makes it somewhat contradictory to established in-universe tech. It essentially creates a physical object with a combination of force-fields, holographic images, and replicator technology. If anything, in your theory, it was LESS likely to work than a real bullet, as it's a forcefield, and it's been shown again and again that two competing force fields will not pass through each other.
2)Very wrong. There are replicators in every crew quarters, in the captain's ready room, sickbay, mess hall, engineering, etc, and of course, there is the larger Replicating Center, where you can replicate larger items. And they Absolutely do have the ability and knowledge to replicate projectile weapons, and they are in the databanks with lockouts to prevent people replicating them - can't block what you don't know, after all - and on top of that, Starfleet Developed their own Modern-for-the-universe's-time firearm, the Klingons had firearms which would be in the databanks, etc, etc. And needless to say, if there was a detailed enough description in the ship's databanks - even if it wasn't replicator information - it would be assumably quite simple to have the computer figure out a replicator pattern(after all, It already knows how to make steel and other metals, and it would be trivial to shape them how it wanted).
3)If they have personal shields that are so effective, you'd think that they'd have already figured out that they might just want to stop projectiles travelling at 1075 Feet per second, which quite obviously have a detrimental effect. Their traditional greeting is not "We are the Borg, but don't worry, We're pretty goddamn stupid." and, you know, they figured out the whole transwarp thing, and a whole bunch of other crazy technology like nanomachines and regenerating ships, so I really doubt that they'd miss the fact that things travelling at high speed will kill them. On top of that, it's been shown many times in the canon that Borg are vulnerable to physical attacks, having limbs amputated, being blown up, shot, and so on.
Also, they can't have shields that guard against projectiles on all the time like their shielding against energy weapons seems to be, because of course, their forcefields are frictionless, and if they were always on, they'd never be able to stand up, as they'd have no traction to the floor, and I'm afraid a bunch of cyborgs flailing about on the floor trying to stand up just are not very terrifying. Ditto that for trying to pick up anything without a suitably sized handle, and even that would be tricky.
Do not try to out-geek me, grasshopper. Down that path lies only defeat.
But the Borg adapts to energy/force weapons so why not bring back the days of gun poweder? but we are going off topicc here.
That we are. Discussion over, unless a new thread is started elsewhere.