Could be weak magazine spring, worn slide stop lever notch,needs lub, deformed mag., "thumb printing". I can tell you 13 things that will cause this, but without seeing the gun or you shoot, it's just a guess.
Today I shot it and it would release the magazine if I had 6 or more bullets in the mag. Since I was already having problems with the slide failing to lock after the last shot, I found a simple fix... I carried it back to the dealer. gave it back and $100.00 and left there with a new one!