This. Same here with my P30, although never an issue with my USPf's, but occasionally with my USPc'sCheck your grip. If your thumbs are close to the slide or even ride the slide during firing then you will disengage the slide release.
Keep count as you fire and on the last round fire it one handed. Betcha $20 it stays locked back.
You'll just have to live with it or modify your grip. My buddy had the same issue with his P30.