Dust grains in circumstellar envelopes are likely to have a spread-out temperature distribution. We investigate how trends in the temperature distribution between small and large grains affect the hot-corino chemistry of complex organic molecules (COMs) and warm carbon-chain chemistry (WCCC). A multi-grain multi-layer astrochemical code with an advanced treatment of the surface chemistry was used with three grain-temperature trends: a grain temperature proportional to the grain radius to the power -1/6 (Model M-1/6), to 0 (M0), and to 1/6 (M1/6). The cases of hot-corino chemistry and WCCC were investigated for a total of six models. The essence of these changes is that the main ice reservoir (small grains) has a higher (M-1/6) or lower (M1/6) temperature than the surrounding gas. The chemistry of COMs agrees better with observations in models M-1/6 and M1/6 than in Model M0. Model M-1/6 agrees best for WCCC because earlier mass-evaporation of methane ice from small grains induces the WCCC phenomenon at lower temperatures. Models considering several grain populations with different temperatures reproduce the circumstellar chemistry more precisely.