In World War 2, friendly fire no doubt occurred. Should this actually happen, what would the outcome be? Would they be court-martialed for their error? How often did it happen?
I think OP should add to the question if the artillery was using wrong data or the scouts/hq delivered wrong data.
Just as a sidenote.
This article at the free library gives an excellent overview of friendly fire and military justice.
The long and the short of it is, the US military has rarely even tried to prosecute friendly fire incidents. And it has even more rarely succeeded in getting convictions when they have prosecuted. Friendly fire is recognized as an unfortunate but always present component in combat. And military juris prudence has been very willing to accept that men with weapons will occasionally shoot in the wrong direction.
If your movie event were to have occurred (and a number of similar events did occur), the most anyone would likely receive is a formal reprimand. And even that was iffy. There were situations far more severe where no complaint or an investigation was made. In general if an artillery battery were to accidentally target the wrong area, they would be instructed to either cease or shift firing. And then the matter would be dropped.