I'm afraid I don't know the best way to go around removing the crab.
One is having to remove the rock which you obviously don't want to do (I wouldn't want to either).
Another way requires some patience. You will want to lure the crab into a trap. You could get an empty water bottle, and cut the part on the bottle where it starts to go into a funnel shape off. Then, take the funnel, and put it backwards into where it was so the funnel is in the bottle. Add some raw shrimp, crab, etc (what we would eat) into the bottle. Put the bottle near the hole right before the lights turn off, and leave it overnight. Check if he went in in the morning.
This works like a lobster trap; the can go in, but do not know how to get out. Just don't put too much food, saying it looks like a small crab, and it may mess up your water parameters eventually.
Did that make sense?