Mobs falling through upwards facing dispensers
With an upwards facing dispenser with no block underneath, a villager (or a pig, and possibly other mobs, which is untested) will fall through the dispenser when spawned. If there is a block underneath it, the mob will spawn inside the dispenser, or halfway inside the dispenser in the case of 2 block tall mobs.