As stated "This isn't a problem. It is just the lenses of the camera moving around when not being used. The lenses are stabilized with electromagnetism. When they aren't used, they will move around as there are no gears or mechanics to hold it into place."
It did, I'm sure you just haven't noticed it before.
es I noticed it too at S20 Unpacked. At the time I was told that it maybe a pre-production unit or whatever, but after watching some tear downs, I have a theory. While there were some reports of click or weird sounds coming from previous models, it's not the same thing. With S20 Ultra it's louder and definitely much more noticeable, but try this... if you open the camera and try shaking the unit, the rattling sound stops completely. Close the camera and it returns. I believe it's the zoom lens autofocusing system. The lens are positioned sideways, and they are on tiny rails, moving left and right when focusing, so when camera is not in use, they move freely when you shake your phone.
I don't think it's harmful to the device, but of course I'd say try not to shake your phone on purpose too much.
I was at the Unpacked in person. And played with these phones on the show floor and in private setting, and I noticed the rattle at that time. It is completely safe and normal for these large camera modules to have some rattle. Some older phones actually rattled too, but since their camera hardware was much smaller, it was much harder to notice. The new Motorola Edge+, that just launched, has a very similar camera set up and it rattles just as much. Some YouTube reviews have mentioned it, but there were also several Forums discussions on this topic too.
Anyway. There is nothing to worry about, just try not to pay attention to it and not shake your phone as much : )