How can I prevent fishing bobber from sinking in lava?

I have a fishing bobber that I don't want to sink in lava. To prevent this I am running code like this: execute as @e[type=fishing_bobber] at @s if block ~ ~-0.2 ~ lava run data modify entity @s Motion set value [0.0d, 1.0d, 0.0d] However, it keeps sinking. How would I be able to fix this? I also tried teleporting it when it's in lava. But that also doesn't seem to work.
Continue to help post