Just tried to reproduce this myself again, this time simply opening the world worked fine. Optimizing the world however still gives me the same result I had before, where it sends me straight back to the title screen and locking the world. I'll edit the bug report. @Galaxy_2Alex could you try again?
you could also add facing to it, for example /fill 2 4 2 6 6 6 orange_stained_glass_pane[north=true,south=true]
Can confirm. Also, it seems like all loot tables are automatically generated when the world is opened. I've modified chests' NBT with a third party program, opened the world and left immediately. When looking at the chests' data it then has all of its loot already generated.