Why does the exoplanetary system TOI-178 challenges current theories of planet formation? I am excited reading the news about ESA's latest exoplanet discovery using CHEOPS. The system TOI-178 consists of (at least?) five planets, following a 18:9:6:4:3 pattern. In the press release, the authors write:

But while the planets in the TOI-178 system orbit their star in a very orderly manner, their densities do not follow any particular pattern. One of the exoplanets, a dense, terrestrial planet like Earth is right next to a similar-sized but very fluffy planet ­­– like a mini-Jupiter, and next to that is one very similar to Neptune.


In the few systems we know where the planets orbit in this resonant rhythm, the densities of the planets gradually decrease as we move away from the star, and it is also what we expect from theory.”

My question: What exactly does &quot;the theory&quot; state exactly? And why exoplanets in orbital resonance necessarily imply decreasing density of the planets if the system did not collide with any other system after its formation?
The original research paper is published is found on A&amp;A and available via arxiv, too.
One of the mysteries to understand in planet formation is the distinction between terrestrial planets and gasous planets - there is no continuous distribution curve. That means that different processes must be involved. Understanding how the involved processes interact, what conditions are required to trigger the individual processes, and how they shape a final system is important for the overall understanding. And this is easiest, the more complete information you have about a system and the better you can deduce its past evolution from the current state. The laplace chaining of the MMR of the planets helps in this endevour.
Thus using this somewhat surprising stability of the system, we can tackle further issues with the formation of the individual planets itself and possibly also the planetesimal-disk interaction. In their summary they state:

In this respect, the different planets of the TOI-178 system lie on
both sides of the radius valley (Fulton et al. 2017). Therefore,
reconstructing the past orbital and atmospheric history of this planet
may provide clues regarding the origin of the valley.

The conjected 'decreasing density' of planets from center outward directly comes from the density of available solid material in the protoplanetary disk: further inward at higher temperatures only the heavier elements can condense. Barring any migration of planets and swapping radial order, this defines the radial density distribution. You see the very same density variation inside our own solar system. The equation of state of matter at high pressures in the planets centres somewhat slightly distorts this, but the general trend applies.