OIS lens' have elements in them that are free moving when the voice coils are not energized. So when you shake it the rattle noise you hear is the element moving and reaching its mechanical limits. This is perfectly normal. When the camera is engaged, the voice coils are biased with a small current that keeps the element very steady. This current is modulated according to the movement to counter handheld shake. It allows longer shutter speeds and lower iso values to improve image quality at lower light levels.
OIS on cameras and lenses have settings to turn it OFF so if the camera is on a tripod focused on still object there won't be interference. I wish there was a toggle to turn it off on phone cameras too because loud music can cause the servo to go into full hysteresis (oscillation) making the video almost jelly like when a kickdrum or synthbass hits hard, etc.