The player was injured while not at bat. Unfortunately there were not enough players to have a pinch hitter when the injured player was scheduled to bat the next inning. The team was required to take an out. How does that get recorded for the scorebook? Does it count against the injured player’s batting average?
This almost certainly depends on the specifics of the league in play. MLB and NCAA Div I rules require a forfeit for a team that cannot field 9 players (and in fact no MLB game has ever used players until only 9 were left and then had an injury, so the scenario has not occurred).
I was able to find several different leagues that allow 8 players (with differences on whether an automatic out is required), including club baseball and high school baseball, but none of them gave any guidance on statistics for the automatic out. (I don't have access to NFHS rules).
Batter/runner stats apply to the player, not to the position. A player leaving the game should be the same regardless of whether the team has sufficient players to replace the spot. So no time at bat or offensive stats should accumulate for the player that has left. For your explicit question, no it doesn't count against the injured player's batting average.
I see some ambiguity for the defensive stats. Is there a player that is credited with a putout? Is the pitcher credited with a batter faced and a third of an inning pitched?
I have some opinions on that, but without some documentation, I'm not going to speculate. Maybe someone else has access to some rules that have more explicit instructions for the official scorer.