A member of my family has a serious peanut allergy. On the whole, airlines have improved in the past 25 years. Over the years, some ways of handling it that we have experienced it have included:
1. Suggesting that the sufferer sit in the toilet while they served nuts (British Airways, late 90's)
2. Sitting the passenger in a separate row from other passengers (can't remember the carrier, long time ago, and what the fuck is that meant to achieve other than the joy of not having people in neighbouring seats?)
3. An announcement saying there would be no nuts served and asking passengers not to consume their own nuts (Japan Airlines, very professional, two occasions and Virgin on a couple of occasions too).
4. When mentioned to crew that we had raised the issue during booking, being told that they hadn't got the message and that they would be serving nuts regardless (Lufthansa, pre-Covid). We suggested that they removed us from the aircraft, get our luggage off and give us a refund. The cabin stewardess said no, so we insisted she informed the captain. She eventually did, no nuts were served and an apology was sent from the flight deck for the lack of understanding.
I think when issues arise is down to poor staff training, or that training not sinking in. FFS, which flight staff want the risk of anaphylaxis at 30,000 feet?
Funnily, I remember a guy on a Virgin flight, complaining loudly to the stewardess that he wanted nuts 'and let the fucker die'. The hostess was brilliant - she simply replied 'I am sure they think the same of you sir'.