The bug
When generating "Amplified" preset or "Customize" presets, desert pyramids generate inside solid ground unlike jungle temples which generate at the surface no matter the height of land.
How to reproduce
Seed [Amplified world]: -1082223639696259069
Coordinates: /tp 1833 66 3763
Code analysis
Code analysis by @unknown can be found in this comment.
Attachments
Comments 20
Issue is still persistent in latest snapshot. Maybe we could call it an inconsistency.... 😉

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. If this has been done, we can reopen the issue.
Keep in mind that the "Resolved"-Status on this ticket just means "Answered", and that we are waiting for further information on whether this issue still exists or not. We will reopen it as soon as the requested information has been delivered.

Partwise confirmed for
1.8.7
Default world:
Seed: -807116175
/tp -1232 72 683
/tp -985 80 -314
/tp -1284 80 -259
It seems like the game generates the temples before it generates the sand
Relates to:

Confirmed for
16w15b
Please add the seed and tp coordinates from the screenshot to the description
Seed: -1082223639696259069
/tp 1833 66 3763
Can confirm in 21w15a.
Can confirm in 1.17-pre4.
Can confirm in all version of 1.16 and 1.17 while using a "Customize" preset generated world.
This bug is also present with Bastions.

This now happens anyway in normal worlds and was resolved as Works As Intended (MC-238647).
14w32b