Inside the Galaxy mobile phone, there is a component that functions as an OIS (Optical Image Stabilization) to minimise shaking when taking pictures with the phone. If this small part is shaken while the camera is not operating, it may hit the internal structure and make a slight rattling sound.
The OIS is a function that detects hand shaking and corrects the lens by moving the lens in the opposite direction of the shake. Due to the different OIS sizes for each product, the sound may be relatively louder depending on the product. This is due to the characteristics of the OIS and is not a product defect. The sound does not affect the function and performance of the mobile phone.