simple entity detection not working

I'm trying to make a very simple datapack that kills all end crystals unless they are part of the ender dragon bossfight(on the pillars) or used to respawn the dragon(on the specific spots on the bedrock), but I can't get the detection working, as it gives me an output no matter what coordinates the end crystal is at. execute as @e[type=end_crystal,limit=1] at @s unless dimension the_end run kill @s execute at @e[type=end_crystal] as @s unless entity @s positioned 3.5 62 0.5 run kill @s
Continue to help post