I can't be sure without seeing the gun, but I suspect the crane is bent, so the end of the center pin is not dropping into the hole in the frame. If that doesn't occur, the latch won't go back and will lock the hammer. (A safety feature to prevent firing if the cylinder is not fully locked into position.)
That may be a fairly easy fix, but it is one that is easy to mess up and make things worse. I recommend taking the gun back where you bought it and getting a refund. If that is not possible, then the best thing to do would be to call S&W and see what they say. If it is only the crane, a good gunsmith may be able to fix it; but the frame could be bent, which is not something most gunsmiths can deal with.
We used to see that quite a bit when cops weren't as PC and hit bad guys with their guns. Some of those guys had heads harder than gun steel, so the gun got the worst of it.
Jim