When you do $ans = -$ans you are trying to take the negative of a compare method, and not of a MathObject, so I'm not surprised that there is weird behaviour.
This explains it perfectly, and as Glenn points out, this is just a symptom of me not understanding what the compare method was returning.
Thanks so much for explaining!