Did you happen to check out the Reddit thread I posted above? Just a quick look at it and you would see that it's not the phone that's the issue, it appears to be the S-PEN itself causing the issue, since if you take out the pen, the phone doesn't make the rattling.Sorry that your phone rattles when you type on it....you should get it replaced.
Some people got free S-Pen replacements from Samsung that fixed the issue, but others got a replacement Pen and still had the issue. Seems like maybe a QA issue with the S-Pen.