There are Live Ball fouls and there are Dead Ball fouls and they are distinctly different and are never interchangeable, much along the lines as suggesting someone is only a "little bit" pregnant.
As suggested, "when in doubt" as to the precise timing of the foul, (live ball/dead ball), deadball is the preferred conclusion. A small consolation of judging the foul a live ball situation, negating the score, is the lesson learned by the player fouling will likely be remembered a lot longer, and not be repeated.