If the second action removed the stump from the ground, probably out, although this will fall within the umpire's judgement. If the second action did not remove a stump from the ground, not out.
Law 29 The Wicket is Down states:
29.2.1. The wicket is broken fairly if a bail is completely removed from the top of the stumps, or a stump is struck out of the ground.
29.3 If one bail is off, it shall be sufficient for the purpose of breaking the wicket to remove the remaining bail or to strike or pull any of the three stumps out of the ground, in any of the ways stated in 29.2.
The first action removed a bail but did not constitute a valid putting down of the wicket as the fielder did not have the ball at the time; therefore it is necessary to either remove the other bail or remove a stump from the ground; the ball just hitting the stump is not sufficient.
As stated though, this is in the umpire's judgement - depending on the exact circumstances, they could rule that the first action had already removed the stump from the ground, at which point a ball hitting it cannot possibly put the wicket down.