Bikingfool covered the basics, but since you say it's a downhill bike, I assume it has rear suspension.
If so, it's possible that the movement of the swingarm is affecting the RD cable length. Possibly a housing is kinked, a ferrule dislodged, or even that the housing section around the flex link is a bit short so a hard bump tensions the cable causing a down shift which then hangs up a bit before returning to the original gear.
After doing the basics, fully compress the rear swing arm and check that the housing is long enough so that it doesn't pull cable. A quick diagnostic gimmick is to slide a cable donut (or a bit of rolled tape) up against the forward chainstay fulcrum and ride a few jumps without shifting gears. If it moves off the fulcrum that's your problem.