The An+1BnO3n+1 Ruddlesden–Popper homologous series offers a wide variety of functionalities including dielectric, ferroelectric, magnetic and catalytic properties. Unfortunately, the synthesis of such layered oxides has been a major challenge owing to the occurrence of growth defects that result in poor materials behaviour in the higher-order members. To understand the fundamental physics of layered oxide growth, we have developed an oxide molecular beam epitaxy system with in situ synchrotron X-ray scattering capability. We present results demonstrating that layered oxide films can dynamically rearrange during growth, leading to structures that are highly unexpected on the basis of the intended layer sequencing. Theoretical calculations indicate that rearrangement can occur in many layered oxide systems and suggest a general approach that may be essential for the construction of metastable Ruddlesden–Popper phases. We demonstrate the utility of the new-found growth strategy by performing the first atomically controlled synthesis of single-crystalline La3Ni2O7.