In order to insure the IS lens elements of Canon EF and EF-S lenses is "parked", the IS needs to be turned off while the camera is powered up before the lens is removed from the camera.
From Roger Cicala's blog at lensrentals.com describing his teardown/comparison of the insides of the EF 70-200mm f/2.8 L IS II versus the EF 70-200mm f/2.8 L IS III:
Looking from underneath, though, you can see the plastic posts that we sometimes mention. These occasionally break, possibly from shock during shipping. If the IS is not turned off, the lens group is free to bounce in all directions with only the posts to stop the motion.
Just because IS is not active and moving the gyros does not mean the IS unit is not free to flop around inside the lens.
Later in the comments section of the lensrentals blog entry Roger responds to a question from a reader and says:
The proper thing to do is 1) Turn IS off at the lens while the lens is still mounted to a camera. This 'locks' the IS unit in place. If you have IS on and just remove the lens from the camera, then it does not lock and off the camera flipping the switch does no good.
You can confirm by gently shaking the lens; there's very little noise if the IS is locked.
The locked position is safer for transporting the lens. If it's not locked the IS unit can bounce around and cause damage. How big a deal is it? I can't say for sure, but maybe 1 in 1,000 shipments that come back with IS not locked are damaged. But the incidence is 0 in 1,000; or very close to that, with IS locked.
If Uncle Roger says it's safer with Canon lenses to turn off IS and therefore lock it, I'm turning my IS lenses off before putting them away in my bag or case. YMMV.