Like for example, if when Mt. Suribachi at Iwo Jima was being lit up by heavy shells a Marine fighter goes in for a gun run but gets inadvertently hit by friendly fire
The USAF used to claim that the USAAF had about a dozen planes shot down by 'friendly' artillery during WWII. Unfortunately I can't find an actual cite for this, and so I can't be sure it wasn't one of those stories that was told just to press home the importance of staying out of the path of a barrage to pilots and/or forward air controllers. Part of the problem is that these stories tend to get exaggerated in the retelling. Also IME the military often loves their lore even when it has no basis in the truth.
That said, in the realm of "things that have more evidence of having happened"
HMS Warspite managed to almost shoot down one of the spotting aircraft at Normandy. Versions of this story that I've heard had the aircraft being almost brought down by turbulence from the shell, but the version I can actually cite only has "the shell came really close". (See Bernard Nalty D-Day: Operation Overlord)
The 90th ID managed to shoot down their own artillery observation aircraft over Normandy with a 155mm shell. (See Edgar Raines Eyes of the Artillery)
Not exactly a "ground attack mission" but there is a pretty famous photo of a C-7 that was in the process of being shot down after it flew into the path of a 155mm artillery barrage in Vietnam.
A quick google search turned up this page which had the photo