Demetallation of organometallic and metal-mediated reactions