I had the exact same issue. In the first case I stopped at a point, it saved, and then I continued for about 3 hours. When I left and got back on it put me in the same spot. I thought it was weird and played for another 20 minutes, then saved, shut down minecraft, and reopened. It put me in the correct spot of where I should have been at that point. I played for another 4 hours and then left for a bit. When I opened realms back up it put me all the way back to the original point, almost 7.5 hours of playtime lost.
I switched to cloudflare dns and the problem disappeared, heres a link on how to do it if anyone wants to try
https://www.windowscentral.com/how-change-your-pcs-dns-settings-windows-10