The bug
Mineshafts, strongholds and villages spawn in the air, in the buffet "Floating Islands" world generation.
Linked issues
is duplicated by 37
relates to 2
Attachments
Comments 13
Affects 18w22c
Bug still present in 1.13-pre1
Affects 1.13-pre6, now they generate all the way down to the void.
Bug always present in 1.14 Pre_5. New villages are affected too.

Can confirm in 1.17.1 Pre-release 1.
It might be possible to make a datapack that fixes this issue. I attempted, but failed.
Still happens in 1.17.1
Hi, um, the "Floating Islands" world setting has been removed in 1.18.1, therefore this can no longer be reproduced.
You can still get this with custom dimensions, avoma.
The floating mineshaft is caused by MC-105035, and the strongholds have always generated like that. This means that this may also relate to MC-70705, which shows (intentionally) glitchy stronghold generation underground.