It would be a red card, and a penalty kick, which the goalkeeper COULD save. So, if you really need to avoid the score and there's only seconds left on the clock, this could be a desperated solution for it, although it's unlikely that such a scenario would happen, in which the only real way to do save the ball is grabbing it, instead of kicking it out - unless he really has covered the goalkeeper with a kick and the ball is coming too high but really going to reach the goal. Nowadays, it's rare to see a defence player so behind due to the offise line strategy.