Entity AI is missing dimension sanity checks, this can lead to players being killed by mobs in Nether/Overworld when the player is in another world. For nether this would require the enter and exit portals to be very close to each other.
I have provided world download that has portal setup in the Overworld and Nether on coordinates 0 75 0
Steps to reproduce: Start a server with the attached world and navigate to the coordinates in the Overworld and go trough the portal to Nether in creative and sit next to the portal in order for the chunks to stay loaded. Next open new client and go to the same coordinates.
Before going through the portal its easiest to give yourself resistance 255 and spawn few zombies using spawn eggs while you are waiting for teleportation. Zombies goes trough the portals instantly and has their portal cooldown activated. After you have teleported to the Nether the zombies should start attacking you, exit the portal and go back in and wait for teleporting back to the Overworld.
After teleporting back to the Overworld the zombies will still target you and move to the position you are in the Overworld and attack your from the Nether dealing damage.
Can confirm / reproduce in 1.19.3.
Also a good way to reproduce is with endermans, build a platform in the end and overworld at the same coordinates. Get one player to stay in the end (to load / tick the world / chunks).
Now teleport to the end platform and look at an enderman to make him attack you. Now teleport to the overworld platform and observe how you still get damage from the enderman from the end.