If you cycle the slide through it's full travel by hand, will the hammer stay cocked?
If yes, there may travel problem to where the slide travel is inadequate to push the slide far enough. Could be anything from excess gunk, to wussy ammo, trigger spring...
If no, the sear engagement is possibly worn or the victim of some sort of "improvement."
When you cock the hammer by hand, is there any odd behavior? Is the trigger really light? Really heavy?
Is it exceptionally gunky on the interior? So many possibilities, don't really know where to start. If you're able to/comfortable with it, I suggest a full detail strip and deep clean. Inspect the internal bits for wear and hamfisted improvements. Then you will know where things stand. Otherwise, give it to a gunsmith for inspection.