Have you tried lubricating the latch device ? Inspect it for unusual wear. How hard is it to lock up, they do require firm upward momentum to close properly, and do wear in to easier lock up and cocking.
Check to see if you have a problem with the cocking lever catching on something as you close the barrel..If it was the locking mechanism for the barrel it should be the same opening and closing.... -Y