Your shrimp was probably dying. Stressed and almost dead animals will be scavenged by blue legs and nassarius snails. If your shrimp couldn't flee from hermit crabs, it was dying.