When using Minecraft 1.13 to open a world created in Minecraft 1.12.2, regardless of whether "optimize world" / forceUpgrade is used, in all north- and east-facing double chests the items from the top half are swapped with the items from the bottom half. In south- and west-facing double chests, this does not occur.
To reproduce this bug:
Create a new superflat creative-mode world in Minecraft 1.12.2.
Put down 4 double-chests, each facing in a different direction (pictured in 1st attached screenshot).
In each of the 4 chests, put a diagonal line of items spanning the width and height of the item grid (pictured in 2nd screenshot).
Save and close the world (a ZIP archive of the 1.12.2 save file at this point is attached).
Open the same world in Minecraft 1.13.
Observe that the north- and east- facing chests have been rearranged (as pictured in 3rd attached screenshot).
Note: I'm aware this is a duplicate of an existing issue and the current status is "Won't Fix", but it was requested by a developer that a more detailed issue be created so this problem can be looked at in more detail:
<+Grum> Hafydd: new issue with small map to replicate the issue would be useful; iirc it was north/east oriented chests
Merged your info info MC-122625 and reopened that.