My theory is that Riku, Sora, Kairi, and mickey went to check out the portal in the cornerstone of light, and got sucked in.
Then they were warped into another reality where Sora isn't the hero, But Riku is. Their bodies morph into different forms due to the alternate reality's different rules...