Field strip it again
If it is locking back when it is not supposed to (i.e. no empty mag inserted), that means something else is pushing the slide stop lever up and catching the slide.
My first step in troubleshooting this would be to field strip the pistol again. Then with no mag in place see if something is pushing the slide stop lever up.
Without a mag in place, it should lay down against the frame. Then insert a mag and see that the slide stop lever is pushed up.
Hopefully with the pistol field stripped, you can see what the problem is.
If it has been detailed stripped, a likely problem is that the slide stop lever spring is in the incorrect place - it should be below the top pin, not above it.
Let us know how it goes.