Reconstruct the inning as if no errors occured, giving the benefit of the doubt to the pitcher. Given your post, here goes...
Batter A - out #1, Batter B out #2, Batter C doubles, runner at second. Batter D pops out to infield, out #3. Unless they changed pitchers after batter C, when the new pitcher inherits the situation (2 outs, runner at second), I don't see how you could be wrong.
At our HS, we use automated software which has issues by definition without human intervention. For example, runner at first with two outs. Base hit to right field. Runner at third is dead by 50' but routine throw goes wild and runner scores. In this case the runner should've been out but wasn't, allowing him to score. Next kid hits HR, next kid strikes out.
In the case above, it should've been no ER as normal throw to third should've resulted in third out.
Same situation where it would've been a bang/bang play at third. You rule runner would've made third and error resulted in scoring from third. HR results in both runs being earned.
I've seen different programs resolve this problem differently, some get it right (2 ER) some get it wrong. It might be how you enter it on the tool, but as an old fashioned book guy who is trying to chart pitches and location on the infernal Palm, I'm being all I can be and just try and get all the runners on the right bases before the pitches start flying to the next hitter. I suspect others have the same issues, but I don't know.
Last season, I started keeping a book to go with the Palm, mainly so I could keep up but partially so when I got lost on the Palm, I could catch up between innings. The thing I noticed was ER's were always off from what I saw and what the tool said I put in.
I now determine ER's at the end of every inning, while my feeble mind is fresh and make a note for the coach later when I turn the Palm back in.
Sorry for the long post, but I feel your pain... Nobody pays attention to these stats anyway, so don't fret about it.