Differential settling and growth of dust grains impact the structure of the radiative envelopes of gaseous planets during formation. Sufficiently rapid dust growth can result in envelopes with substantially reduced opacities for radiation transport, thereby facilitating planet formation. We revisit the problem and establish that dust settling and grain growth also lead to outer planetary envelopes that are prone to compositional instabilities, by virtue of their inverted mean-molecular weight gradients. Under a variety of conditions, we find that the radiative envelopes of forming planets are experience compositional turbulence driven by a semitransparent version of the thermohaline instability ('fingering convection'). The compositional turbulence seems efficient at mixing dust in the radiative envelopes of planets forming at super-AU distances (say 5 AU) from a Sun-like star, but not so at sub-AU distances (say 0.2 AU). Furthermore, compositional layering is favoured only at large (super-AU) distances. Such distinct turbulent regimes for planetary envelopes growing at sub-AU vs. super-AU distances could leave an imprint on the final planets formed.