Each naturally-generated Sandstone Chest will always contain one primary item, and may contain one or two secondary items. Besides one of the items listed here, they will also contain common items depending on the height they were found in: Underground or Caverns.
The exact way the loot works is that when the first Sandstone Chest is generated, it will take from the second loot pool. Then, before each chest is spawned, the "center" of the biome is calculated as (3 * y1 + 4 * y2) / 7 with y1 being the top of the top-most Sandstone Chest and y2 the bottom of the bottom-most Sandstone Chest. If the chest is spawned on the top of this "center", it will take from the first pool, otherwise from the second.