If you're trying to lock the slide back with an empty gun, using an empty magazine, and it fails to lock back (without you pushing upward on the slide stop lever), typically there's a problem with ...
Damaged magazine follower
Damaged or worn magazine spring
Dirty magazine
Damaged slide stop
Damaged side plate
I've also seen a couple guys reassemble their 4006TSW magazines with the followers installed backwards. This located the little shelf on the follower (that engages the slide stop lever) on the wrong side of the magazine, where it couldn't be engaged by the slide stop lever tab.
If it were me, I'd inspect the magazines to make sure the followers are installed correctly.
View of .40 follower from right side:
View of .40 follower from bottom, with left side of follower facing bottom of pic:
I'd take the EMPTY pistol and EMPTY magazines (as many mags as you have), and briskly retract the slides on the empty mags to see if the followers lift the slide stop levers and lock the slide back. If they don't, it's possible you have older/worn springs that need replacing.
S&W recommends its armorers replace recoil & mag springs either every 5,000 rounds fired, or every 5 years of normal service use, whichever occurs first.
I'd check the slide stop lever assembly to make sure the plunger is under tension, and freely moves in & out if you push against it.
I'd check to make sure the side plate is fixed in position. (Not uncommon for someone to unintentionally tweak and damage a side plate when removing/installing factory grips, if the top front/left corner of the grip snags under the side plate and exerts excessive pressure upward against it when installing & positioning factory grips.)
BTW, a locked back slide normally can be released - with or without a magazine in the gun - by simply pulling back on the slide and letting the spring tension of the slide stop lever's plunger push the lever downward, out of the slide's "stop notch".
One of the normal bench checks an armorer does is to take an empty pistol, and its empty magazines, and briskly run the slide to the rear, letting it go, with each magazine. If the slide isn't captured by the follower/slide stop, the mag spring is probably getting too weak. The "next" symptom is usually the slide failing to lock back in live-fire, and/or last round feeding failures.
A weakening recoil spring can start to let the gun batter itself, which is how slides and frames can get cracked/damaged.