Synthesis of heterocycles using group-4 metal catalyzed C-N bond formation