Metal-enriched atmospheres in warm (super- and sub-) Neptunes induced by extreme atmospheric escape