In baseball, "ERA" = Earned Run Average, is calculated via nine innings (also, "E.R.A."). This is a pitcher's statistic.
So, let's say that a pitcher completes the nine-inning game, and he gives up 3 runs over 9 innings. Since 3 runs were scored via 9 innings, that pitcher's ERA is 3.0 (9 innings calculated with three runs).
If the pitcher would had given up 1 run per 9 innings, his ERA for that game would be 1.0. (You can look up the statistics.)
Now, let's say Pitcher A ("A") gives up a walk. Then, Pitcher B ("B") relieves pitcher "A" and "B" comes in and gives up a home run. Via today's (6/23/2022) rules, A is charged with 1 run, and B is charged with 1 run.
Now, here is my theory. Since "A" has given up a walk (25% around the bases), after the home run, "A" should be given .25 ERA, and B should be charged with .75 ERA since B gave up the home run.
Maybe there should be a statistic on all that. Let the programmers decide, if they wish.
I wrote to Dick Young about this decades ago re: how to calculate the ERA via my suggestion. Mr. Young rejected my idea, in print. It was nice of him to print my suggestion, and address the issue, in print.