Ghastlings and happy ghasts only take damage when hugging on a wall but I did a experiment where I made a hollow box and 1x1 was ghastling and 4x4 was happy ghast then they die when hugging on a wall face first
Steps to reproduce an issue
Create a world
Open up chat and type /Fill ~~~ ~2 ~7 ~2 cobblestone hollow for happy ghast type /Fill ~~~ ~5 ~13 ~5 cobblestone hollow
Next set your gamemode to spectator so ghastling won't follow you
Then summon a happy ghast or ghastling for ghastling type /summon happy_ghast ~~~ 0 0 minecraft:spawn_baby
Now they take damage to hugging face first to a wall
Actual result
Happy ghasts and ghastling take damage when hugging face first on a wall
Expected result
Happy ghasts and ghastlings won't be able to take damage face first on a wall
Resolving as a duplicate of MCPE-221320 since that report has more information.