If you happen to accidentally eat one maggot then likely nothing bad is going to happen.
I have accidentally eaten a maggot before in some cheese and did not realize it until I actually swallowed and had a piece of the maggot in my teeth.
That was gross and made me want to vomit but I couldn't.
I went to the doctor and they said that nothing bad should happen but if I started getting a stomach ache then I may have bacteria poisoning and should go the emergency room.
But nothing never came of it.
I was a bit sick for a few days and then I was okay after that.
If you eat more than 1 maggot then you could really get sick so if you have food that yous see and know maggots are in you should discard that food and not eat it.
The maggot Larvae has also likely been in contact with feces which is poop such as human poop, cat poop animal poop etc.
So you could get sick.