If the defense properly appeals the runner leaving 3rd early he will be called out on for an apparent 4th out, which will negate the run scoring. If the defense does not appeal then the run counts.
One more thing, different rule sets may specify the time limit for the appeal to take place. In OBR the defense has until the last fielder leaves fair territory. Other codes may be different.
There is video in the Close Call Sports section of this forum from a few weeks ago showing this very occurrence.