Friendly fire was more common in WWI than it should have been. Due to the inaccuracy of mortars and other airborne explosives, troops would sometimes be killed by their own gunners. In some cases, mortars actually landed on ally trenches.
Often offensives were planned so that soldiers attacked less than a minute after the shelling stopped. In these situations, it was not uncommon for soldiers to be ordered to attack too soon, leaving them at the mercy of the shells.