Note: Again, I cannot find dupes and this issue is the opposite order of MC-202198 and MC-140727, and it’s also related to MC-203636.
As the title said, underground structures (such as dungeons, mineshaft, amethyst geode, fossil, etc.) can spawn directly in trees. This happens in certain circumstances such as in custom superflat or even much rarer in default worlds, when tree(s) spawn(s) very low under the ground and underground structure(s) see(s) this as a valid place to spawn in (which of course is not as ideal place for structures to spawn in).
Here are 2 ways to reproduce this:
1st:
Step 1: Click the following: “Create New World” -> “World” -> “World type: Default” -> “Customize” -> “Presets” -> “Overworld”
Step 2: On “Want to share your preset with someone? Use the box below!”, replace the “plains” with “jungle”.
Step 3: Click the following: “Use Preset” -> “Done” -> “Create New World”
Step 4: Type “/locate structure minecraft:mineshaft”, then teleport to the mineshaft => Notice that it will be spawned in tree.
2nd:
Step 1: Click the following: “Create New World” -> “World” -> “World type: Default” -> “Customize” -> “Presets” -> “Overworld”
Step 2: On “Want to share your preset with someone? Use the box below!”, replace the “plains” with “forest”.
Step 3: Click the following: “Use Preset” -> “Done”, then on “Seed for the world generator”, type “5465756855319734293”, then click “Create New World”.
Step 4: When spawn in, make sure to face north then fly in a straight line for about 800 blocks => Notice that in the left corner of the screen, there's an amethyst geode spawn in the tree.
Note: This is not caused by MC-215423, to see why, here’s the 3rd way to reproduce this:
Step 1: In a default world, place a repeat command block, then type “execute at <username> run place feature minecraft:amethyst_geode ~ ~ ~” then change “Needs Redstone” to “Always Active”.
Step 2: Go in spectator mode, then fly through the large oak trees which spawn in forest, you might have to do it a few times (or a lot of times) => Notice that the amethyst geodes spawn in the tree.
With that, we can assume that in theory, the fact that an anderground structures spawns in tree(s) in default world is possible when a “big hole” spawn in a forest (or other similar biomes), which then have some dirts expose the air, which then large tree(s) (or other similar trees) can spawn in (note that trees spawning underground is intended, see MC-243147 and MC-218938), which finally an amethyst geode (or other similar underground structures) can spawn in. However, the odds of that are very very low and I can’t and won’t find it. So if you find one, write the seed in the comment.
Linked issues
Attachments
Comments

I also cannot reproduce, due to the Customize
button being disabled on the Default
world type:
Are you sure this is not MC-10666, or could it be related?

Sorry for the confusing wording, you guys thought that "When the world type is "Default", click on "Customize".". But what I meant was "Click on "World type: Default" to turn from "Default" to "Superflat", then click on "Customize".".
As for @Jiingy, MC-10666 only works for mineshafts and strongholds while the report works for any underground structures including an amethyst tree you see earlier. Furthermore, floating mineshafts never generate for a while and strongholds can generate in the air without any non-air blocks at all.
Can confirm for the mineshaft generation, though it is a bit weirder than expected:
[media]
Edit: Flying around x=-48 and z=-343 in the same world as in my screenshot reveals a few more artifacts of broken mineshaft generation in trees.

Cannot reproduce for the amethyst tree, however.
[media]Can someone else attempt to reproduce the amethyst tree just in case I misread the instructions?

Okay, I now know the reason why @Viradex couldn't find the amethyst tree. So an hour ago (when this comment was post), I actually found another amethyst tree in that same superflat setup but in different seed and coordinate (5465756855319734293 and -192 ~ -681), which is closer than the previous seed. However, when I tried to reproduce this again, I didn't find the amethyst tree again. I was hopeless. But then I tried something, and it worked. Turn out, when I teleported directly into the location of the amethyst that suppose to spawn, the amethyst tree was there anymore, but when I flew from the world spawn to that location (flew on a straight line and facing north), the amethyst tree magicly appeared. This probably has something to do with chunk loading. Nevertheless, I reproduced this for 3 times and will update the description.
When the world type is Default, the Customize button is disabled for me.
[media]