Many things will drive out maggots. An old mycologost friend of mine,French, would put mushroom caps in a lidded pan with an egg-cup full of petrol overnight. This did the trick quite nicely….of course, being French, he was evacuating the maggots in order to eat the muchrooms. Others of his nationality were not so fussy….they ate them maggots and all.
I have used PVC solvent to good effect. It has the advantage of being a blobby gel which just turns solid over a few hours, but maggots expire during this short time.
On a side note, I annually collect a kilo or two of H.repandum from a certain location which we shall visit later on. This year the blighters have “first flushed” rather early and are under attack from tiny, thready fly (unknown) larvae. I do not eat them as I find the smell of petrol repulsive.