Command works when i run it, but not in function

function works, and tested, but idk why this is execute positioned ~ ~1.25 ~ run kill @e[type=minecraft:interaction,distance=0.01..]
Continue to help post