Planets formed closer into the Sun and migrated outward (or not) as they interacted with one another or extrasolar influences, potentially driven by transitory resonances. Our solar system has been pretty stable as far as the major planets are concerned for billions of years but we see a diverse array of different configurations in exoplanetary systems, some of which are unlikely by conventional theories of planetary system development and are probably in transition. In our solar system, all of the dense-core rocky worlds are closer to the Sun and the large and icy ‘gas giants’ are in the outsystem, divided by the Asteroid Belt, and this has influenced our conventional models for planetary development.
As @LSLGuy has already noted, having two comparable-sized bodies at opposing points in the orbit is not stable. It is possible to have smaller bodies in the leading and trailing (L4 and L5) libration points, or stable couplets of two similar mass co-orbiting bodies which are tidally locked to each other, but because orbits aren’t perfect circles and are subject to perturbations by other planets, bodies opposite each other in orbit will advance or retard their progress, eventually getting completely out of phase and ‘rubber-banding’ each other into separate orbits that will overlap and eventually make close approaches to one another.
Stranger