It actually wasn’t a foul, in the rules that you can play the ball away like that if you’re knocked to the ground, can actually score from it as well!
Rule 1.2 - When the ball is on the ground, it may be played by any part of the body except the hand(s). It may be lifted off the ground with the feet.
(i) The goalkeeper may play the ball on the ground with his hand(s) inside his own small rectangle.
(ii) Any player who falls or is knocked to the ground while in possession of the ball may fist or palm the ball away on the ground, and may score by so doing.
(iii) The ball may not be lifted off the ground with the knees.