The Silk Road (and presumably the darknet markets that followed it) let any user contest the charge and get their money automatically, which they almost certainly would do if they got MDMA that tested badly.
Further, if this happens too many times, the marketplace will just seize the account. Vendor accounts are expensive, so it doesn't make economic sense to sell bad shit.