Next time it happens, try to press left click before you do anything; this most likely isn't an issue with DayZ.
Here's what probably happened:
1) You pressed left click while the DayZ client had your mouse pointer.
2) You did something; or for some reason your computer began to "capture the output" of your mouse.
3) This happened in a way, that DayZ never knew you released the mouse pointer.
4) DayZ thinks the left mouse is being held down; although left click is not being held down.
Next time it happens to you, try pressing left click, then raise your weapon. If it fixes it, then it's probably not an issue with DayZ.