If I join a realm and select a item in my main hand, then create or join an new single player world and while joining click outside the minecraft box area where the game runs, then log back in, I come to the Esc menu and see in my main hand, that same item I put in on my realm.
How to Recreate:
1. Log into a minecraft realm.
2. Select any random item or block in your main hand
3. Log out of the realm
4. Create or join a single-player world
5. While it is joining/creating click out of the box that minecraft runs in and click on any other random box like the finder or launcher
6. When it is done, look back to the minecraft box and see that the item you had on the realm in your main hand.
Note: when you click "back to game" the item dissapears.
I think this is the same for other single player worlds.
(To recreate, do the same as above, except instead of a realm use a single player world)