You don't have the coord multiplication coefficient for nether portals - if you travel to the nether, you need to divideby 8 (?), and back from nether you multiply again.