A batsman while facing a spin bowler is coming down the track, misses the ball and tries to make it back to the crease. The wicket-keeper fumbles and hence delays stumping the batsman. Meanwhile, the batsman reaches the crease and disturbs the stumps with his bat in the process. Now, will it be given as hit-wicket? Remember, disturbing the stumps when trying to make your ground while taking a run is not hit-wicket.
This is not out.
The law is very clear - see https://www.lords.org/mcc/laws-of-cricket/laws/law-35-hit-wicket/ - section 2 has clause 3, which says it is not out when "it occurs when he is trying to avoid being run out or stumped."