According to a news report, the F-35B Joint Strike Fighter "shot itself in the skies" which is pretty painful, we had a splinter there once. The pilot was unharmed and successfully landed the jet, but it managed to do at least $2.5 million in damage, fortunately to itself.
The Pentagon isn't quite sure how or why the jet shot itself, and the incident is still under investigation.
According to Military.com, the F-35 was flying in a training mission at night on March 12 at the Yuman Range Complex in Arizona when it shot itself.
This particular F-35 has an externally mounted Gatling gun that fires a 25mm armour-piercing high explosive round. Sometime during the training, the weapon was discharged, and the round exploded, damaging the jet's underside.
The F-35 is the most expensive weapon ever built and intelligent weapon ever made but problems have plagued it since Lockheed Martin began manufacturing them in 2006. In May 2020, an F-35 costing $175 million landed too hard and "rolled, caught fire, and was destroyed.".
The accident report gave several reasons for the crash, including the F-35's speciality helmet and its inability to deliver oxygen properly to the pilot. So, in that case the plane tried to kill itself and take the pilot out with it.