My M2 did the same thing. I could induce it by pulling the bolt to the rear an delaying returning forward slightly thus activating the lifter. Bolt would lock to rear. Initially it did not do it under livef ire then suddenly the bolt began to lock back after firing several rounds.
A very knowledgable Benelli forum member advised to change out the carrier spring. It fixed the issue.
Good luck.