First thought is you are interfering with the slide release/stop when firing. This is the easiest way to explain it happening intermittently.
Underpowered ammo? What are you using? High velocity stuff works flawlessly in mine, but I have had the slide not cycle once with a noticeably weak round.
Dirty? Have you cleaned it recently? Dirt could cause enough friction combined with weaker ammo to not allow the slide to go back far enough.
Limp wristing? It's a .22, but it will take all of the rearward force that the little 22 cartridge can muster to make the slide recoil fully. If your wrist is absorbing any of that recoil force it could be causing the issue.
These are the more likely culprits, but if it is only happening randomly I would think it is either your grip intefering with the slide stop, or a limpwrist issue.
If not, examine the slide notch where the slide stop engages. There should be no wear and there is actually a steel pin there for the engagment surface as the aluminum is not hard enough.