Mobs are not suffocating inside blocks. This was seen from a raid where a ravager spawned inside a savannah hill and somehow not suffocating. This also affects players
To reproduce
1. Spawn any kind of mob
2. It's either placing sand, gravel or red sand on a hole in one block or use a sticky piston and push a solid block to a head of a mob.
Fixed in 1.12.0.4 Beta