To actually study the match frame by frame to see if the star-KO-ee leaves the screen before the star-KO-er gets KO-ed him/herself would take waaaaaay too much time. This isn't the NFL, and we don't have the technology or resources available to bring up a challenge eeeeevery siiiiiingle tiiiiiime this happens, which shouldn't happen very often in competitive play.
Most of the time, the reason this happens is because the stage would kill the "winner" after the fact. But most of the allowed stages can't really kill you, so if you die first then it's your mistake for not paying attention to the board.
And if it wasn't the stage's fault, then it was your fault. You shouldn't have gone for that crazy suicide KO with only one stock left and/or so much damage accumulated, even though you did do a good job by actually getting the KO.
And if it wasn't the stage's fault, and it wasn't your fault, then it was your opponent who countered your attack with an attack of their own. Should they not get their deserved KO?
I say: whoever the game declairs the winner, IS the winner. //endstatement