I don't know exactly how ammunition is assigned. Is the total amount split evenly between all dwarves, and they will only pick up that much? Or will they fill their quivers and deny lower-priority squad members access to the ammunition?
The bolts you assign to a squad are for the whole squad. If you want each dwarf to have a full quiver, then you have to assign
at least 250 bolts to the squad, assuming a full 10 members. Assign 500 to be absolutely sure (see below).
A quiver nominally holds 25 bolts, but this is not really how it works. In reality, a quiver has no specific capacity; it simply cannot hold
any more stacks of bolts once it has 25 or more bolts in it. A marksdwarf will try to fill up her quiver. She'll do this by grabbing one stack at a time, until the quiver cannot hold any more stacks.
If a marksdwarf starts with an empty quiver, and the first stack she grabs has 25 bolts in it (the amount produced by a metal forge), then she's done. The quiver is "full".
However, if her quiver already has some bolts in it, then the stack she grabs may put her over 25. This is not a problem for the quiver. The extra weight may be a problem for her, and the bolt shortage may be a problem for the rest of the squad... or not. Always assign a crapload of bolts to your squads. Always make twice as many bolts as you think you need.
I don't know if it's still happening in 42.x as i don't use this wall/fortification setup anymore, but in 40.x marksdwarves were stupid enough to jump - through - fortifications that were on top of my walls after a few seconds of shooting at an enemy. I had lost several of those idiots against a serpentine-like titan with their stupid stunt.
One theory I've seen is that the marksdwarves are actually climbing
over the fortifications, and that a roof over the fortifications will stop them. I haven't tested this myself.
I've found them [macedwarves] to be pretty worthless against undead. All they do is cause bruising, which doesn't bother the undead very much. I guess after a few dozen bruises in the same location it will get pulped, but one or two axe hits and it's removed.
Which version are you playing? There was a major change to the undead in 0.42.05.