I was joining a world with my friend on survival that we've played multiple times. When I joined, the world reset me back to spawn and I had none of my items. When I left this world previously (probably around two weeks before I joined again today), I was around 3000 blocks from spawn with a full hot bar and inventory. My friend and I then joined a creative world to see if we had the same issue there. We didn't have any problems, but when we joined a separate survival world, the same glitched happened and I was back at spawn without any of my items.
You might try logging out and back in as sometimes that can fix the issue.