Spear-yielding mobs continue to target the same mob they are retaliating. This affects all spear-yielding mobs that are retaliating, and not mobs that are simply chasing another mob or mobs that are idle.
In my example, the zombified piglins are retaliating towards a skeleton located at around 125, 125. They are teleported to 1000, 1000 in the overworld, but they still point towards 125, 125. This affects spear zombified piglins, not sword zombified piglins.
In the videos attached, you can see all the sword piglins facing straight forward for the turtle egg, but the spear piglins point at a 45 degree angle. This is because in the overworld, they are at 1000, 1000, pointing towards 125, 125, which are the skeleton’s coordinates. You can also see some getting stuck and not moving/climbing (even though all sword piglins can do it). Not only that, but they become completely idle (won’t even rotate randomly like other zombified piglins do). This is inconsistent behavior caused by using spears.
This likely means there is a bug in the code responsible for mobs retaliating using a spear. This can cause them to get stuck at the bottom of climbable blocks (not moving at all even though other zombified piglins are moving towards a turtle egg). This also causes strange behaviour (zombified piglins appear to point towards a direction even though they are walking straight). They could also stop pursuing turtle eggs until you reload the world. A fix for this is to make them not pursue that target until they re-enter the same dimension as their target (or they will forget the target after 20 seconds).
Please edit your report to change the Affected Version to the version shown on the Minecraft title screen