Yikes. Your symptoms were likely caused by calcium oxalate raphides, little mineral needles present in raw agave (and several other plants). https://en.m.wikipedia.org/wiki/Raphide
Wild plants, on the other hand , has not been subject to the same selection process and could easily contain a dangerous amount of oxalate.