I talked to a few engineers and (while slightly drunk) they came up with a mechanism for a self powered automatic crossbow. Basically, it involves bolts being loaded in cartidges together with a very strong coil spring. When the trigger is pulled the spring unloads, pushing back both the bolt and the bowspring over a tilting part of the stock which is depressed by coil spring pushing gown a small triangular wedge in it's path and is released when it encounters a small notch, after which it is lifted in line with the rest of whatever you calls the crossbow equivalent of a gun barrel by another spring below it when the bolt is fully removed from it's storage, which disengages the bowstring from being pushed back and launches the bolt forward. The cartridge pushed out by a protrusion on the bowstring, which makes room for a new one, either pulled in place by being connected to the previous one or being pushed up from a magazine.
Tl;dr version: Uses pre-loaded springs for chambering a new round as opposed to recoil like with a firearm.
I can imagine a million ways something that operates completely on precisely calibrated springs under high pressure can malfunction, perhaps a chance that when firing the crossbow breaks down into a non-crossbow that can be converted back to a crossbow by a marksdwarf as a workshop like job that can be performed everywhere and is automatically added to the tasks of the dwarf whose weapon just failed?
If there's any large lapses of logic in the text above it's because:
1. The engineers in question have an expertise area not related to crossbows(electrical systems)
2. We were all drunk at the time.
3. I suck at converting a drawn sketch into words.