There are multiple things that can cause a revolver to not be accurate. Most often cause is the ammo being used. Next check the muzzle for wear, damage, unevenness. Check the cylinder for excessive play forward and backward as well as side to side. Is the lock up tight? With the gun empty, pull the trigger and hold it back. How much play, if any, is there in any direction? Does the trigger pull extremely hard/rough? Are the cylinder throats excessively large? Is the timing correct and cylinder alignment correct?
As you can see, there can be many causes, and it needs to be diagnosed. I would have a friend, with known ability shoot it over a sandbag rest, and keep the targets of also scattered. A 25 yard group from your type gun should be in the 3" range +/-. Once diagnosed I'm sure S&W can repair it.