Trees will always replace the grass/mycelium under them with dirt. This does not apply to huge mushrooms, regardless of whether they were generated that way or grown by the player. This is no big deal, but it does cause miniscule performance drops from updating blocks, which will happen when growing huge mushrooms, or discovering a roofed forest or mushroom fields biome.
Using the seed 5878760421836343227, teleport to 72 72 38 and break the "stumps" of the tree to show the intended behavior, and teleport to 34 64 -8 and break the "stumps" of the two closest huge mushrooms to see the bug. Make sure you do this quickly or the soil under the huge mushrooms will decay (or just turn randomTickSpeed to 0 right when entering the world).
Linked issues
relates to
Attachments
Comments
Can confirm in 1.18.1.
Can confirm in 1.19.
Can confirm in 1.19.2.

Affects 24w13a:
[media][media]
Thanks to MC-166238, I have discovered that trees will also replace mycelium under them with dirt.