Hello Mitz
I am fortunate not to have suffered this but it sounds like onion fly whose maggots are in your shallots. You can still eat most of them but they won’t keep for as long as usual. And I am unsure whether this means your soil has some in…. Some areas have it more than others, but all alliums seem suddenly harder to grow. Leek moth caterpillars are busy at present and in checking my shallots I found some neck rot, from mildew!
That your onions are fine is good; so just keep the shallot bed free of alliums for at least two years.