why when i go rlly far away and die do i start spawning at spawn?

heres tick

scoreboard players reset @e[type=player] deaths```

and heres tp spawn tho i dont think it matters
```$execute in $(dimension) run tp @s $(x) $(y) $(z)

scoreboard players reset @s deaths```
Continue to help post