It's a game mechanic. If you die the turn you rapid spin (ie. rocky helmet, iron barbs, rough skin, etc), the rocks won't get removed.In this battle I had, I used rapid spin with a life orb Starmie against a Ferrothorn to get rid of rocks. Starmie died from Iron Barbs damage and the rocks stayed up. I was wondering why this happened, is this a glitch on showdown or is it just some strange mechanic, because I've never seen this before. Here is the replay:
http://pokemonshowdown.com/replay/ou-187886960
Fast forward to turn 20 if you don't want to watch the whole thing (although it was a decent battle)
e: Haha Ender and Darnell :<)