Macro error

My game crashes and lags really hard when I do this: data modify storage quantum:distance_to_target y set from entity @s Pos[1] function eval:ray/cast1 with storage quantum:distance_to_target

cast1 say yo scoreboard players set @s distance_to_target 0 $execute positioned ~ $(y) ~ facing entity @p[tag=xlib_target] feet run return run function eval:ray/ray1

ray1: execute as @a[dx=0,gamemode=!spectator,tag=xlib_target] positioned ~-0.99 ~-0.99 ~-0.99 if entity @s[dx=0] run return 1 scoreboard players add @s distance_to_target 1 execute positioned ^ ^ ^0.5 run return run function eval:ray/ray1

Continue to help post