Yes they are compatible. I suppose the crab was already dead, otherwise they wouldn't harm each other. You mentioned that you just got those blue legged hermits. I think she was a weak one, who did not survive the transportation. If your cleaner shrimp healthy and looks happy then your water parameters should be o.k.
I hope it was helpful.