The sun and the solar wind seem to do a good job of fractionating lighter materials to the outer solar system and leaving heavier materials in the inner solar system. So we end up with rocky/metallic planets in the inner solar system and the gas giants and ice giants in the outer solar system. But why are the gas giants (Jupiter and Saturn composed mainly of Hydrogen and Helium - the lightest materials) closer to the sun than the ice giants (Uranus and Neptune composed of water, ammonia, methane, etc.)?
It is now generally accepted in the planet formation community that planets form as a side-product of the star formation process in so-called protoplanetary discs.
Protoplanetary discs have initial masses of few to tens of percent of their stellar host masses, are relatively cold (T<150K in about 95% or more of their mass, which is outside the water iceline for a standard MMSN model) and are hence mostly detected in the infrared. The radiating infrared component is the 'dusty' component (first published detection and confirmation via the IRAS satellite in 1984-1985) making up about 1% of the mass, the other 99% being H/He gas.
Those discs are accretion discs, i.e. they loose angular momentum through various processes, which leads to mass infall into their host star. The dust settles into the midplane. For the case of turbulent accretion, dust and gas will be well-mixed and accrete relatively uniformly into the star, while in the case of disc-wind-driven accretion, H/He in the upper layers of the disc flows over the midplane and provides the accretion rate. Disc accretion rates can be too much for what the star can actually accrete and the excess mass is ejected vertically in jets that can exist throughout the disc lifetime, their mass decretion rates correspond typically to 1-50% of the disc accretion rate.
I mention the water iceline solely as point of reference, as its exact effect on the physics of planet formation is heavily debated, it currently cannot be observed, and icelines in several other molecules such as $\rm CO, CO_2, N_2,...$ could be playing roles too.
Our solar system originated very probably in one of those protoplanetary discs. We cannot follow the formation process over the disc lifetime, as this takes between 1-20 Myears (median value 3-5 Myrs, depending on the survey) and hence as often in astrophysics, we rely on snapshots and exoplanet statistics to try and puzzle together the physics.
50% of all exoplanetary systems harbour several rocky super-earths at radii interior to the water iceline. 6-10% of all stars possesses cold gas giant planets (giant planets at semi-major axes >0.5 AU) and 0.5-1% possesses hot gas giants (giant planets at semi-major axes <0.1 AU). While from this our solar system seems to have an unusually low mass in the terrestrial planet zone, nonetheless physics seems to prefer to build rocky planets interior to the water-iceline. Those processes must happen in the protoplanetary disc phase and possibly shortly after gas removal (<100Myrs, it is poorly constrained which fraction of its final mass Earth possessed at disc dispersal).
Rocky planets are also thought to form beyond the water iceline. However in those regions of the protoplanetary disc, the mass reservoir is enormous and rocky planets can achieve runaway gas-accretion before their parent disc disperses. Reaching runaway gas-accretion consists of two steps: First, after the rocky, multi-earth-mass planet is formed, it aquires an atmosphere that is hydrostatically connected to the disc via its own gravitation. This atmosphere cools slowly via Kelvin-Helmholtz cooling. The contraction allows for more mass to flow into the planetary domain, forming a massive atmosphere. Should this atmosphere reach a mass important enough for self-gravity to help the contraction further, the planet accretes more the more it cools and it cools more the more it accretes, hence runaway accretion is reached.
The architecture of the solar system
With all this, we can formulate the standard explanation for the architecture of the solar system:
Jupiter and Saturn are standard cold gas-giants that underwent a phase of rapid core-assembly and subsequent runaway gas-accretion. Uranus and Neptune grew far out in regions of low disc gas density (or small dust populations, increasing the core-assembly and cooling time) and hence were stuck in the hydrostatic gas accretion phase until the disc dispersed. The "ice" in ice giants hence refers to the solid component making up 60-80% of their mass, and not that they missed runaway accretion, which would make for a clearer name.
Now the other question is, why planets at small radii seemed to have evaded runaway gas accretion, in our solar system and at least 50% of exoplanetary systems. A candidate mechanism is "gas recycling", i.e. replenishment of entropy to protoplanetary atmospheres which prevents their contraction. This is possible close to the star because the gas is very dense, replacing cooling with advection as dominant entropy transport mechanism.
The broad strokes of the solar system architecture can be understood in terms of physical mechanisms which have been shown to work in simulations. However, when applying those same mechanisms in order to form synthetic populations of planets, those synthetic populations are usually inconsistent with the observed ones. This is work in progress and needs future missions to the ice giants in order to measure their detailed heavy element abundances and use the latter to distinguish between competing formation scenarios, of which I have presented merely one.
The physics presented here is therefore very different from a simple 'heavy elements sink in solar wind' picture, which to the extent of my knowledge, was never considered as candidate for a planet formation model. Merely Laplace in the 18th century considered a similar sounding model of yours, of an extended solar atmosphere that centrifugally breaks into rings in order to form the planets. With my prelude as above, this model is now known to be incorrect however.