Did complex organic compounds arise in space or were they created and then ejected from planets? Why must it be one or the other? The answer is almost certainly both.
Experiments with pure lab grade MgO crystals––grown from the melt––have demonstrated that organic compounds, chiefly long aliphatic chains, are rapidly and spontaneously synthesized within the crystal itself. This research is not at all speculative. Over 300 compounds have been directly observed, most created by the addition of additional monomers to a growing chain. This process occurs wherever crystallization of oxide materials occurs "within a gas-rich environment." That is to say it occurs virtually everywhere from the titanic outpourings of exploding supernovas, to the ash and lava spewed from volcanoes, to the crystallizing magmas deep within the Earth, these solid-solution chemistry and solid-state physics effects obtain. A great deal of this research has been done at NASA-Ames Research Center by Dr. Friedemann Freund and his late son Dr. Mino Freund.
The existence of these organic compounds within the interstellar dust––and their ready synthesis by the same rock crystallization process in the laboratory––strongly suggests that the vast preponderance of organic compounds in the universe are created not by living systems, nor within idealized "warm puddle" conditions, but in the most unexpected of origins––solid rock. Almost as a bonus, this process also sequesters a previously unanticipated reservoir of reduced hydrogen within the crust and mantle, which is vast if dispersed thinly.
Much has been hypothesized about the products of cold gaseous chemistry within the dust clouds. Surface synthesis may well occur, but such products are vulnerable to periodic destruction by supernovas. An interesting consequence of this solid solution chemistry process is that the products, arising within the rock, rapidly reform when the rock is melted and cools. Even within microscopic grains, components like C, H and N can be conserved, reduced and recombined from melt to solid phase as these reduced components are systematically excluded from the crystal. Thus, our universe is virtually awash in complex organic polymers and their monomer components––from rocky planets and asteroids to the most evanescent dust clouds. Solid solution chemistry rocks!