Agility also give some crit. Crit gives you more combo points. More combo points gives you more uptime on the envenom debuff, which increases the damage of your poisons. I think once you factor in all the multipliers and how all abilities scale/relate - it’s a very not obvious relationship between Agility and AP. The relationship is going to be very close between the two stats. I trust the robot.
If I look at BiS - the optimizer isn’t picking agility gems. So it probably has to do with your particular setup.