Sounds like it was doing ground attack training. Impacts with ricochets are quite common under the right(?) impact conditions, and risk of impacts is always present, especially if there is a hard target.
Rarer, but also seen are impacts from high speed, long range fire in air-air shooting, where the aircraft catches up with the stream of shells a long time after firing.