When a shulker visually rotates, its hitbox does not immediately rotate along with its visual rotation.
This is best explained in a video rather than listed reproduction steps, so please see the attachment.