This was an extremely interesting theory! I honestly never would've thought about it at first but it definitely makes sense. When I first played this game and the whole cutscene at the keyblade graveyard confronting terra-xehanort happened again, I didn't skip it. I knew something up and that something was very off. But the only problem I have with this theory is that why does the scene of riku sacrificing sora happen twice? It happens for a second time after you piece sora back together, but before you save everyone else from the lich and returning to the Disney worlds. VTNVIVI, a YouTuber who is a massive kingdom hearts fan, even pointed this out. Can you explain that? Otherwise really good theory. It makes so much sense!
Also with what i said about the whole cutscene happening twice riku sacrificing himself for sora, one theory around it I do have is that maybe that whole scenario happened twice but to no avail, or maybe just to "remind" us of what already happened. Get me?