Hey Raxus_,
In order for you to truly beat the Grass Gym, you must still have pokemon alive in your party when you beat the leader's last pokemon. If your last pokemon died from recoil and you killed the leader's last pokemon, that will not count. Sorry for the inconvenience. If there's anything else, feel free to let us know!
Cheers!