Yeh,thats not supposed to happen.
But on occasion when i insert an empty mag and pull the slide back it wont engage the slide stop effectively.
A few things can make it better,and im guessing 1 would fix it but could cause feed issues requiring extra work.
Making it better: Clean and lube the mag and follower.Clean and lube the slide stop mechanism and also hit it internally threw the bottom of the mag well with a long straw or take the slide off and do it from the top.This should make sure the mag follower is reaching its max height which is needed to engage the stop.
What would fix it,but possibly cause feed issues is to adjust the mags tension on the sides of the follower.This will allow the follower to fully extend a lot easier.But in doing so its also easy to affect other things such as the angle the round is held at and it wont feed correctly without more different adjustment.
Id just do the first part with cleaning and lubing,and last resort is to send it back to S&W if need be.If thats not possible messing with the mag follower tension may do the job.
I know you said the issue happens when inserting a new mag,but why its happening is the slide stop is barley engaging and putting a new mag in makes it release.