  The origin of the elevated C/O ratios in discs around late M dwarfs compared
to discs around solar-type stars is not well understood. Here we endeavour to
reproduce the observed differences in the disc C/O ratios as a function of
stellar mass using a viscosity-driven disc evolution model and study the
corresponding atmospheric composition of planets that grow inside the water-ice
line in these discs. We carried out simulations using a coupled disc evolution
and planet formation code that includes pebble drift and evaporation. We used a
chemical partitioning model for the dust composition in the disc midplane.
Inside the water-ice line, the disc's C/O ratio initially decreases to
sub-stellar due to the inward drift and evaporation of water-ice-rich pebbles
before increasing again to super-stellar values due to the inward diffusion of
carbon-rich vapour. We show that this process is more efficient for very
low-mass stars compared to solar-type stars due to the closer-in ice lines and
shorter disc viscous timescales. In high-viscosity discs, the transition from
sub-stellar to super-stellar takes place faster due to the fast inward
advection of carbon-rich gas. Our results suggest that planets accreting their
atmospheres early (when the disc C/O is still sub-stellar) will have low
atmospheric C/O ratios, while planets that accrete their atmospheres late (when
the disc C/O has become super-stellar) can obtain high C/O ratios. Our model
predictions are consistent with observations, under the assumption that all
stars have the same metallicity and chemical composition, and that the vertical
mixing timescales in the inner disc are much shorter than the radial advection
timescales. This further strengthens the case for considering stellar
abundances alongside disc evolution in future studies that aim to link planet
(atmospheric) composition to disc composition.
