So the laws changed in the 2022 code, as described 2022 Code Changesthe text of law 41.16 has been moved to law 38 run out.
From the Laws of Cricket - Run out
38.3 Non-striker leaving his/her ground early
38.3.1 At any time from the moment the ball comes into play until the instant when the bowler would normally have been expected to release the ball, the non-striker is liable to be Run out if he/she is out of his/her ground. In these circumstances the non-striker will be out Run out if he/she is out of his/her ground when his/her wicket is broken by the bowler throwing the ball at the stumps or by the bowler’s hand holding the ball, whether or not the ball is subsequently delivered.
38.3.1.1 The instant when the bowler would normally have been expected to release the ball is defined as the moment the bowler’s arm reaches the highest point of his/her normal bowling action in the delivery swing.
38.3.1.2 Even if the non-striker had left his/her ground before the instant at which the bowler would normally have been expected to release the ball, once the bowler has reached that point it is no longer possible for the bowler to run out the non-striker under this Law.
38.3.2 If the ball is not delivered,
- if there is an appeal, the umpire shall make his/her decision on the Run out.
- if there is no appeal, or if the decision is not out, he/she shall call and signal Dead ball as soon as possible.
- the ball shall not count as one in the over.
38.3.3 If the ball is delivered and there is an appeal,
the umpire shall make his/her decision on the Run out.
if the non-striker is not dismissed, the ball remains in play and Law 21.6 (Bowler breaking wicket in delivering ball) shall apply.
if the non-striker is dismissed, the ball shall not count as one in the over.
So as per the laws both scenario A and B above are actually dead ball. The ball shall not count as one in the over.