3-2 count, umps lose count of balls when another ball is thrown. So now its 4-2. The umps have lost count, and so has everyone else. Another pitch is thrown and a HR is hit…
NOW. The coach of the team in the field realizes what has happened and brings it to the umps attention. What happens???
Same situation but the batter hits a foul ball and the count is still 4-2 and the batter realizes whats happened and and brings it to the umps attention. In theory the result should be the same as above. Whatever that is.
Of course a ML ump could answer it, because if there’s no rule that covers it, the ump is specifically allowed to rule on things that are not covered by the rules.
Rule 8.03(a) says the home plate umpire is responsible for “calling and counting” balls and strikes. Miscounting balls and strikes is, to my mind, therefore an appeal decision as per 8.02(b).
So the second part explicitly mentions a missed ball-strike count, and says that it cannot be corrected after the next batter (or the defensive team leaves), which very strongly implies that a correction CAN be made before then, even if another pitch has been thrown to the same batter.
Then the first part says the umpires can put things how they should have been had the call been right.
So my reading is that the rules pretty clearly say that in the OP’s situations the umpires could and should take away the HR or foul ball and award a walk to the batter.