Sounds eerily familiar. I had two piston M&P's that both jammed repeatedly, even after going back to Smith. At least one failure every few mags. Just enough to never trust the guns. I never got mine running well, so I sold them at a loss with full disclosure. But try all the usual "fixes".
Run it clean and WELL lubed
I even went as far as buying different buffers/springs, etc. Hopefully you get it straightened out. When mine came back from S&W they didn't seem to be any different than before, other than a huger accumulation of shop dust and some new scuffs and scratches.
Best of luck to you, S&W seems to treat most customers rather well. Maybe I called them on the wrong day and wrong time
"An angry prophet, denouncing the hypocrisies of our time"