This is the best idea I can come up with. Certainly, my military never approached the glitch treant, which was located right at the map edge, prior to its becoming glitched.
I don't know how Dwarf Fortress hacking works. I'll tell you mechanically what I did.
In Dwarf Companion, when I opened the treant's creature details, the "dead?" box was checked, but the "dead" box was not checked; truly dead creatures have both boxes checked. The glitch treant had no wounds.
When the "dead?" box was unchecked, the treant reappeared occupying the same tile as a tree on the edge of the map. If left unhindered, it walks up to my fortress gate, then seems to realize the siege has failed and all its comrades are dead, and turns tail to flee. This shows that the treant still has hostile intent, and most likely the glitching event occurred when the treant first entered the map. I was not watching the treants as they began their attack, nor do I have saves from that point (Dwarf Fortress doesn't exactly encourage the maintenance of multiple saves).
I think the tree growing on the treant at the same time it stepped on the map simply confused the game as to the treant's status, triggering the "dead?" flag. Unchecking the flag allows the treant to reappear, clearing the glitch. Since it is surrounded by empty grass squares, it walks normally through them along its original path (as 3 hypothesizes).
The game did not record the existence of this treant as alive in the units list; if the game recorded it as deceased, I could not tell it from the other nameless treants listed there.
Either way, I haven't heard of the [grasstrample:0] glitch yet, and it seems noteworthy and worth addressing, considering elves have it.