Nether portal (that has been used both ways) suddenly move

Minecraft uses some basic math to determine what nether portals should link with each other. In the overworld, a portal will check if there is a portal in the nether near its coordinates divided by 8. This is to make the nether feel smaller than the overworld. I do not know why your portal suddenly isn't working, but I bet your problem would be solved if you went to your portal in the overworld, divided it's X and Z coordinates by 8, and built a portal in the nether at that location.