I wasn't aware you could even shake her off. Also, the switch puzzle is confusing, as I can't see any sort of pattern. I try clicking them based on the one that is outlined red, but that didn't work either, just random chance has done the job.
Same here I can never get the switch puzzle correct and when Sammy blocks me, especially with a bomb it's a little crazy trying to fix things after when two of them start attacking the doors at the same time.