If the slide does not lock back when manually cycling with an empty mag inserted, there are generally two reasons.
1: If the gun is a 3-pin frame, make sure the spring for slide stop(it's not a slide release, it's job is to stop the slide when empty) is below the locking block pin. If above it, the spring won't push the lever to contact the magazone follower. If this is an older 2-pin frame, this is not the problem.
2: If it's not the slide stop spring placement, it's ALMOST ALWAYS worn a worn out magazine spring. They don't have to be horribly weak, just enough and they won't push the follower up far enough to engage the slide stop lever. It's an incredibly common and more often than not overlooked failure point
Springs are cheap, always have spares on hand. I usually get the Wolff Gunsprings 3 pack from Brownell's.
If you've installed a mag extension and didn't use a longer spring, this is in effect the same thing as a weak spring. Any company that says their + whatever extension doesn't require a longer spring is WRONG. Anytime you change the length of the mag, you need to change the length of the spring, it's pretty basic. That's why all the real companies that sell extensions either include or recommend a spring upgrade. If they don't either include or recommend a spring, I move on.
Adding a +2 to a G19 mag? Use a factory G17 spring or an upgraded spring.
A good way to verify if it is indeed the sriing that's the problem is to remove the spring, stretch it out, reassemble the mag and try again.
Also be sure to check the followers and make sure they aren't worn down. It's rare, but it can happen. It's a plastic follower engaging a steel tab on the slide stop.
When I replace mag springs, I update the followers if they need it.
If you ever get a chance to take the factory Glock armorer's class, DO IT! I thought I knew everything there was to know about Glock handguns, but oh boy, did I LEARN A LOT.
Good luck!