Almost true. Good thinking though.
There are exceptions to this rule, so it's more of a guidance than the actual rule. For example you could have two planets orbiting the Sun at the relatively similar distance from the Sun and a small distance from each other.
Well, that's not the issue here. The issue is two planets can't exist near each other because they can't possibly have formed that way 4.5B years ago and kept existing at that point since then. Their gravitational influences would have long since caused them to collide into each other and form a single planet. There's a reason there's big gaps in the orbital distances of every planet; it's simply not possible to pack them in too tightly.
That's still the same scenario, just slower to become apparent. You need to change other things, like they orbit each other as they go around the Sun, to change this.