To use a participle or an infinitive? That's the question
You have two possibilities, both grammatical, but with different meanings
- "harming" means that they did not, in fact, harm the mice
- "to harm" means that they took the care for the purpose of refraining from the harm.
Either harming or to harm would work, but the sentence really needs an again at the end since they already harmed them before.