CO2-rich protoplanetary discs as a probe of dust radial drift and trapping