This could have happened with any surgery requiring anaesthesia.
There should be a way to test patients beforehand, if they have never been under anasethesia to see if they are allergic.
There is, but it involves a muscle biopsy and is prone to false negatives.