The random chance aspect would have been more apparent if you included the dwarf planets and re-thought the ‘rocky’ planets.
We recently (kinda arbitrarily) redefined the definition of a planet to be more strict, and that is what lead to the rock->gas ordering, when a slightly different definition would have lead to rock->gas->rock or rock->gas->rock->gas->rock ordering.
And the idea of gas vs rocky is more a function of size. There aren’t going to be giant rocky or tiny gas because amount of gravity vs amount of wind from the stars is what allows those compositions to exist.
So, as has been observed in other star systems, the ordering on size (and therefore, composition) can also be random.
Latest Answers