That rock was unconsolidated. Basically, it was sediment and not rock. Sediments need to be buried within the earth to become rock. At a minimum, about 4,000’ before the process begins. One exception are reefs which are lithified as they are created. Think about peat that forms in a swamp. It has to be buried quite a ways before it becomes coal.
Well, I guess the “rock” formed since the recent eruption of Mt St Helens isn’t...
Crystallization/bonding is all that is required per evidence. “Time” is not of the essence. Massive amounts of water dissolving calcium and or other minerals provides ample cementing.
In your example of a swamp and coal, the critical factor is depth and hence more importantly time. However, even in oxygen depleted conditions, organics don’t last eons. Unless they were buried rapidly...