If getting food on a flight is a medical issue, someone should be bringing their own food.
[1]https://www.theguardian.com/uk-news/2019/may/02/boy-with-all...
Besides if someone has a contact allergy to nuts, I can't think of a place more likely for it to happen than a plane. One patch of turbulence, and your seat neighbor's peanuts go all over you.
Both of these flights were TATL but on the lower end (5-7 hours) of the time range. The restriction only applied to our section of business class, which neither time was fully booked.