How do you know that this is the problem though? I had a similar problem with my 3G, where I could hear something rattling inside, but only sometimes. It would cause the phone to randomly lock or turn the volume up/down. I got it replaced.
Perhaps it is just the camera, as I haven't played with a 3GS, and haven't been able to shake one, but you shouldn't say that it's nothing as a fact, as there could be something wrong.