Shulkers will only apply their natural armor after opening their lid and then closing it again.
Steps to reproduce:
spawn a shulker
wait for it to open its shell and close it again
hit the shulker with your fist
observe with the command /data get entity @e[type=shulker,limit=1] Health that the shulker now has 29.78 health, showing that the natural armor is working
kill that shulker and spawn a new one
hit the shulker with your fist again, but this time make sure you hit the shulker before it has a chance of opening its lid
observe with the same command as above that the shulker now has a health of 29, showing that the natural armor is not working, even though its lid is closed
(this effect can be more clearly seen by using a weapon instead of a fist)
Expected: shulkers always have their natural armor applied if their lid is closed
Observed: shulkers do not have their natural armor applied when newly spawned in (also probably effects duplicated shulkers, but would require a more complicated setup)
(Edited for a simpler setup to reproduce)
Can confirm on 1.17.1