Origin of the metallicity dependence of exoplanet host stars in the protoplanetary disc mass distribution