Did climate cool down when underground hydrocarbons stocks formed?
Possibly

One thing you have to understand is that natural carbon sequestration via the formation of fossil fuel is VERY slow, it can take millions of years to build up the coal we burn in a day. In addition, one of the more dominant effects on the climate is solar radiance and continental position which changes over such long stretches of time, making matching such slow changes to carbon with climate change more difficult. Continent position also affects carbon sequestration and CO2 concentration directly making it even more confusing. Things like seaways and deserts can have huge effects on CO2. 

The real problem is matching coal formation to changes in CO2 concentration. 
Most coal comes from the carboniferous and the Permian time periods (along with the evolution of land plants that make it), the carboniferous saw severe cooling and severe drops in CO2. How much of this is CO2 lost to coal versus how much is just the formation of forests and other terrestrial ecosystems combined with changes in contingent positions is still up for debate.

The Permian however saw severe warming near its end and a rapid rise in CO2 at the same time, but most of it was relatively stable and unchanging both in CO2 and temp. It also included one of the largest volcanic events in earth's history, and again changing tectonic position. So although the link between CO2 and temperature is really well established we can't even say for sure such slow coal formation actually reduces atmospheric CO2 concentrations. 



source

Compare CO2 above to temp (red line) below. Note that just three variables together predict temprature amazing well.


source