Heyo,
So after some testing I was able to get the command working, however it seems the effect of it does not go through for some for some reason. So for the commands, these are what I got:
/entity cmd e[!] stopanim walk
/entity cmd e[!] stoptask all
Those will affect everyone, including yourself, and I got the message that says it went through successfully but the only one that would work is walk because it shows it happening, but it seems it's not permanent because if the entity goes into another animation, the one that was stopped is reset and you would have to retype it to stop it again, at least from my testing.
BTW If you want to target other things than Gazelle, spawn the entity, type /entity list and then do the command with e[type=EXACTNAMEOFLISTEDENTITY]
So in the case of the gazelle (male), the command would be /entity cmd e[type=gazelle-thomson-adult-male] stopanim walk and it will work and only affect the male gazelle (My entity code is most likely different from yours since I have the FotSa mod installed)
stoptask and stopanim are interesting because you can put the command I listed and it says it executed successfully, but you can replace "all" with any word and it will say the same thing. So I think we would need to put the actual AI task in there exactly how it is in the code for it to function properly (Yeah I know, obviously it would be that but I just found it interesting it accepts any string with no issues).
I'll keep playing around with it, but hey, we're making some type of progress, haha.