Question: are gnats on food harmful?
Answer: Yes, they don't do any harm unless they've laid eggs in the fruit and there are maggots in it. Even eating the maggots (or one or two accidentally) wouldn't do any harm, although many people would find that rather unappetizing.