Here is a video showing how to collect a ball when you are behind the stumps or close to it. A fielder/wicket-keeper needs to be behind the stumps or next to the stumps to collect the ball, but not in front of it.
A fielder has to allow the ball to reach the target(stumps) and then hit the stumps/bails. Not collect the ball before the stumps!.
Here is a gfx video)