There are a couple rules that relates to the number 24 and somewhere close to the number 24.
As pointed by MrLemon in the comments the 24 block rule may refer to this as quoted from minecraft wiki
There must be no players and no player spawn points within a 24 block
distance (spherical) of the spawning block
This means that you should stand 24 blocks away from any thing that the mob can spawn at. Simplest way to do this is to Build it about 30 blocks above you, have the mob fall 22/23 blocks as explained below and stand there while afk-ing.
Do take note that 30 blocks away from the floor is the absolute limit for you to afk farm mobs. This is due to the follow fact quoted from minecraft wiki.
All mobs except slimes will stop wandering within 5 seconds if there
is no player within a 32 block radius. In this state, they will glance
around randomly, but they won't walk anywhere.
This means that if you want to make a mob farm, without pistons pushing them off, then the only way is for you to be within 32 blocks so that they would walk off naturally. However this has an exception.
Zombies can walk when there is a villager they can attack even if they are over 32 blocks from a player
This means that if you place a villager within the sight of a zombie mob farm, it will still move towards the villager even if you are beyond 32 blocks away. Although even with that, The outer limit that hostile mobs will despawn is 128 blocks away thus a play must always be within 128 blocks for the mob to spawn at all.
The 24 block rule can also apply to the distance at which the mob has to fall. This means that from the hole at which the mob starts to fall, to the ground where the mob lands at must be 24 or at minimum 23 blocks to have a guaranteed death.
This is due to the fall damage formula. An entity starts to recieve fall damage after falling for more than 3 blocks. For every block fallen after 3 blocks the entity recieve half a heart or 1 point of damage. This means that 23 blocks later it would have exceeded 10 hearts of damage for the entity and therefore making sure the entity dies.
The formula is as follows
(DistanceFallen - 3) / 2
hearts of damage
As pointed in the comments by Marco Geertsma, You can make this more efficient by having a 22 block drop instead of a 23 block drop. This would require you to perform the last hit to kill the mob but it would also grant you EXP in the process.
One way to do the 22/23 block fall interchangeably is to have pistons push up the block to make it 22 and pull it down to make it 23. This way, you can make it automatic when you want to afk and manual when you need the exp.
For further information you may want to refer to the minecraft wiki on
Mob spawning
http://minecraft.gamepedia.com/Spawn
Mob AI
http://minecraft.gamepedia.com/Mobs
Fall Damage
http://minecraft.gamepedia.com/Damage
Best Answer
This seems to be a bug in 18w43c and possibly some earlier versions: https://bugs.mojang.com/browse/MC-138337
Mobs don't spawn above the highest block that was naturally generated with the world. I don't know why this happens, this is a really weird bug. Some people started analysing the code a bit, but it'll likely take a while until it's properly figured out.
For now I would recommend to stay on 1.12.2, it's the best performing and least buggy version. For more details and reasons, see this answer.