I think in the US, it's basically an intractable problem the way restaurants operate and are staffed. Low margin, high failure rate businesses with many fly by night small operators. Front of house staff is high turnover, while back of house staff is largely non-English speaking of sometimes questionable immigration/work permit status.
And then there is the supply chain since most restaurants are not cooking every single part of every meal from absolute scratch ingredients.
There was a story about a woman near us operating some sort of celiac friendly/gluten free bakery. One day the donuts were delivered and she noticed some D shaped sprinkles and realized her supplier had come up short and just put some random Dunkin Donuts into the delivery. Good on her catching it, but how in good conscience could she operate a bakery advertising itself as celiac friendly/gluten free if she was outsourcing like this?
If I had any sort of food allergy that could result in hospitalization or death, I'd just stop eating out. I'd rather be a little boring than very dead.
Why would you run a bakery and not make donuts yourself? They're dead simple if you have a fryer.