The function run through the `run_command` entity effect type runs in the wrong dimension / always in the overworld.
To reproduce, download the attached datapack and add it to a world. Then follow these steps.
give yourself a pickaxe
enchant this pickaxe with the test enchantment using
/enchant @s test:test
while holding it in your handmake sure you're in survival mode
hit a nearby block. Observe how you get teleported to that block.
go through a nether or end portal
hit any block there
observe how you're getting teleported to the corresponding block in the overworld instead.
All the function does is this:
tp @s ~ ~ ~
Can confirm.
[media]