Scientists did about 14 thousand simulations of the development of the solar system and saw that the mysterious giant
Simulation described in a journal articleNature, showed that at the dawn of the solar system, the gas giant planets had round and regular orbits. But around the Sun at that time there was a protoplanetary disk of gas. Inside it, the star heated up and "displaced" the gas from the disk. This gas carried away the gas giant planets.
The terrestrial planets are more fortunate:they formed after this period of instability. But the supposed giant Planet Nine could have been forced out of the early solar system. That is why attempts to find it were unsuccessful.