If it locks back with an empty mag inserted, it will lock back without the mag, by manually pushing the slide lock lever up, with the slide fully racked back. The issue may be that you are not getting the slide fully racked back. You need to fully rack the slide back, push the lever up and keep it held up, and then allow the slide to move forward, against the lever. You should then be able release the upwards pressure on the slide lock lever, and the slide will be locked back.
Bob