That's the paradoxical effect. It happens, sadly, with most psychiatric medicines. No one really knows why, but a small percentage of people end up getting worse. That could have been at play with your wife. Or it could have been a nocebo (negative placebo) effect, or just the course of the attack. For example, the worst panic attacks tend to come on suddenly with a defined liminal point (not an upward creep of anxiety throughout the day) and peak 3-7 minutes afterward. If she took the Xanax at the liminal point and felt worse 5 minutes later, that's not because of the drug, but the panic attack's initial upward swing.
The truth is that benzodiazepines don't really abort a panic attack-- at least not in the short (<5 minutes) term. Nothing really can. What benzos are great for is recovering from a panic attack and preventing it from rolling into another one. If your wife felt shitty for 5 minutes, but great at T=30 minutes, then it's not the drug's fault because the drug worked.
SSRIs also have a paradoxical effect. I think SSRIs are somewhat like a less risky version of electroconvulsive therapy: they induce a change of state in the brain, and the brain's response gets it out of a depressive cycle, but it's not clear why one state change ("shock") works and another doesn't. To make it weirder, when people are on SSRIs for a while there's a tendency for the drug to stop working ("poop out"). No surprise: this sounds like tolerance. However, at this point both raising and lowering the doses can work. So it seems like any change in this state variable is what can cause the improvement, but no one really knows. (That said, never hard taper on an SSRI, and definitely don't reduce dosage without talking to a doctor.)