Don't forget that while the body is a machine, it's also electrical and chemical.
Two police officers get into a shoot out with a suspect, who is killed, one officer gets the tip of his pinky shot off, despite the fact his partner tourniqueted the finger with a shoelace, the officer slipped into shock and died.
That's blood sugar at work, your body gobbling all of it up then vapor locking when it runs out. (hence the treatment for shock resembles what you get after giving blood, calm them, warm them, and get them to eat a cookie and some juice).
Over stimulation of the Vegas nerve can cause cardiac arrest. . .because you can short out an electromechanical system.
Similarly, you can be knocked spinning or unconscious by pain, like say a crushed hand can knock you unconscious, despite it not being your head/brain directly effected. Pain in a toe can make you vomit, despite your digestive system being remote from the toe.
So if say someone smashes your leg with a mace, all sorts of nerves over fire into your brain with pain signals, and your glands dump loads of hormones into your system. (including insulin which causes the shock above)
You get a magical fix on the bone, muscle and skin damage to the leg. . .your body and brain might still be tilting on the electrochemical storm the injury set off. . . .
Flipping the logic the other direction, a taser/stungun stuns/scrambles your bio-electrical systems while causing minimal injury, and many drugs and chemicals can do the same to your biochemical systems. Stun and shock are your body doing the same thing to itself, via nerve impulses and hormones.
Consider how, just after a fight, even if you sustain no injuries, you often get the shakes, nausea or lightheadedness. . .that's your body reacting as it starts damping out all the electrical activity, and filtering off all those hormones. . .they don't merely vanish in an instant, they linger a while. . .It's magical healing, so it's hard to apply real life logic to it, but in real life, having a shattered femur suddenly made whole might shut off the pain signals and hormone production, but it wouldn't instantly clear their effects from the body. . .the unstunning magics would seem to do so.