this is still a issue
Your using the distance tag wrong. It should be /data get entity @e[distance=..5,type=minecraft:shulker,limit=1] for it to detect all entities in a range of 5 blocks away from you,
The reason why is that ..5 is equal to a whole five, and this parameter works in decimals (example: 1.1)
This only seems to happen with newly employed villagers, if you destroy a job site block in a village (a naturally empolyed villager) it doesn't crash.