NCAA Rules:
Mistakes by Officials
SECTION 12. When a timekeeper, scorer or official makes a mistake
that would result in a team or player being penalized and another official
becomes aware that a mistake is being made, that official shall promptly correct the mistake. If goals are scored during the mistake made by the timekeeper, scorer or official and it is brought to the attention of the referee before the next live ball, the referee must allow or disallow the goal, depending on the circumstances.
A.R. 64. B1 is serving a one-minute penalty. After 30 seconds of play, he is released by the official timekeeper and B2 scores a goal. Team A notifies officials of timekeeper’s mistake. RULING: Goal does not count, and B1 returns to special-substitution area to serve his remaining 30 seconds. Ball is awarded to the team in possession at the time of
the error (or, if the ball was loose, by the alternate-possession rule).
So in NCAA rules, A1 goes back in the box for his remaining penalty time, and the ball should be awarded tot he team in possession at the time of the early release (if you can figure that out) or by A.P. if loose.
NFHS Rules:
SECTION 13 CORRECTIONS OF ERRORS
When a coach believes an official (game Official, bench official, timer or scorer) has misapplied a rule, the coach may approach the scorer’s table to request a coach/official time-out for the purpose of discussing a possible misapplication of a rule. This request must be made prior to the next live ball. The timer shall sound the horn when there is no significant action, and the discussion shall take place in the Table Area in the presence of both coaches. If the official has misapplied a rule, necessary adjustments will be made and an explanation given to both coaches. No time-out will be charged and play will immediately be resumed. If there was no error in the application of the rule, the time-out will be charged to the requesting team; should there be time remaining for the charged time-out, the coach may utilize the amount remaining. The coach may not debate a judgment call. The coach/official time-out is limited to the possible misapplication of a rule.
7.13 SITUATION B: B1 is in penalty area for one minute. After 30 seconds of play, he is released by the official timekeeper and B2 scores a goal. Team A notifies officials of timekeeper's mistake. RULING: Goal does not count, and B1 returns to penalty area to serve his remaining 30 seconds. Ball is awarded according to the alternate-possession rule.
So the only real difference between the NCAA and Fed is that Fed only awards by A.P., while NCAA allows for possession to be retained by the team in possession at the time of the error.
Give the ball to the appropriate team where the ball is at the stoppage of play, outside the attack area.