Here a dogwood clubgall midge seems to have pupated in the gall rather than in soil.
dogwood club gall cut open to show chamber formed by the maggot and a dogwood clubgall midge pupa

Photo by J.R. Baker, NC State University