In 1.17 and below, badlands are meant to place gold below the surface and mountains were meant to place emerald and infested stone below the surface. That used to work pretty well, although 1.18 introduced 3D biomes which means another random biome (dripstone/lush cave, or another biome) might generate below which causes the areas where the gold/emerald was meant to be to not contain gold/emeralds.
As you can see in the screenshot, it is badlands above but because it is technically a forest where the player is at, no excess gold is generated. This is rather unintuitive, as there is no indication other than the F3 debug screen that no gold will generate.
Lush caves for example generates azalea trees even if it's technically outside of the biome. Badlands and mountains deserve the same treatment.
Linked issues
is duplicated by
Attachments
Comments

Yes, that is also an issue. But even if that issue is fixed a lush/dripstone cave (which IS meant to generate underground, potentially below a badland or mountains) would interfere with the placement of extra gold or emerald ore. And yes I am aware dripstone caves already places larger copper blobs. I believe both emerald/gold and more copper in one place is good for the game though if you come across those two biomes in one place.

As CalXee noted, this is more of an issue with cave biomes than MC-236619, here's the seed and coords of a high mountain with an entire dripstone cave below.
[media]
Almost every emerald ore generation was skipped in favor of dripstone caves.
But the fix might require special ore generation not depending on the current biome, unless a similar method to how azalea trees generate was applied to generate specific-biome ores all the way down.

How on Earth does this 'work as intended'? It's clearly broken as hell.
The broader issue here is biomes are being placed where they otherwise shouldn't. Different biomes in the same y-scale (with the exception of mountain and cave biomes) will cause different foliage colors as well.