^ This is the biggie.
@CoachChuck , to confirm, you can simply shoot the gun with your left hand or, alternatively, "hitch-hike" your right (I'm assuming dominant) thumb (particularly when shooting single-handed: either that, or completely bury it ["making a fist"]) to insure that you're not impeding the function of the slide-stop/release as the magazine follower pushes it up at the end of the mag.
Occasionally, the support (left) hand of a right-hand-dominant shooter can also be the issue: it can both cause the catch to not engage or to engage early. If this is the case, simply fixing how you are placing that hand on the frame of the gun should solve the problem.
Cleaning usually doesn't make much of a difference, here. The mechanism by which the slide-stop operates is that it is moved upwards by the follower at the end of the latter's travel inside the magazine body, as the last round in the mag is expended. It is possible that debris could get into the recesses of the mechanism and keep it from coming up and/or some kind of weird collection of debris could have accumulated either at the end of the slide-stop or in the notch cut into the slide where it needs to engage, but that's really stretching it.....
Usually, if there's an actual hardware issue, it's going to be something to do with the magazine follower being broken (and thus physically unable to displace the slide stop upwards to engage), magazine spring tension loss (through use-cycles, but this typically takes
A_LOT_ of use to incur --->
Springfield xdm 9mm mags ), the slide stop spring itself having broken or was installed improperly (typically both are incurred during reassembly from detail-stripping), or a chip in the slide.
If you just started using different ammo in the gun, what you've seen can potentially point to a unique-gun/unique-ammo issue. If this is the case, simply note what ammo you've just switched to, and set it aside for training use: I would specifically choose to load it as the last round fired in random magazines so that you can train towards a spontaneous and unexpected failure-to-lock.
Look at it this way: yes, a defensive/duty semiautomatic handgun should lock that slide back on the last round, but on what is already arguably the worst day of your life - when you have to bring this firearm into the equation to save your life of that of a loved one's - what else can possibly go wrong?