The Earth has a core for much the same reason that it's a spheroid: Gravity.
When you have as much stuff as there is in the Earth, it's own gravity is so great that it simply isn't strong enough to hold its shape. All it can do is fall until there's nowhere to fall to, which leads to a sphere.
Similarly, dense materials sink while lighter ones float on top of them. With the enormous forces involved, solid rock acts in some ways as if it were a very very thick liquid. (most of the Earth's mantel is "plastic" rock like this rather than outright molten)
Iron and nickle are the heaviest materials that make up a significant portion of Earth's mass, and so that's what we find at the centre. Two cores would require having something less dense between them that they could displace to reach a lower equilibrium.
You could spin the planet until the cores are in equilibrium, but then anything above them would be moving FASTER than orbital speed and so the planet would fly apart.
You could move them at a different rate from the rest of the planet, but the friction would be staggering. It would very cause the cores and the planet to sync up, the cores would then merge together. The heat produced would probably melt the surface of the planet.
You could make the planet hollow with two giant balls orbiting each other inside each other. I'm not sure but I think the co orbiting balls inside would be stable with respect to one another, but would not be stable with respect to the sphere in the same way a Ringworld is unstable relative to the star it contains. You would need active attitude control to maintain distance.
There are also problems with building a planet sized hollow shell that can hold up under its own weight, or a pair of cores able to withstand spinning around each other that fast.
Such a thing is obviously not a naturally occurring phenomenon, and the cores would spin around each other in minutes, not hundreds of thousands of years.
That all aside, Earth's magnetic field is pretty complicated without needing multiple cores. Among other things it seems to occasionally drop into chaotic behaviour as if the core were several cores (there's only one but different parts of it are behaving differently) and then can re-emerge with the field running in either direction. This happens chaotically on the order of millions to hundreds of thousands of years apart, with the chaotic transition periods taking hundreds of years to tens of thousands of years. This is called a Geomagnetic Reversal
At least one science fiction writer has used this as a plot point: Robert J. Sawyer's Neanderthal Parallax trilogy involves a geomagnetic reversal.