Generally when something like this happens in Rallying the affected competitors are awarded a "fair" time by the clerk of the course. As the WRC sporting regulations put it:
When a special stage is interrupted or stopped for any reason,
each crew affected will be allocated by the Clerk of the Course
a time which is judged the fairest. However, no crew which is
solely or jointly responsible for stopping a stage may benefit
from this measure
This obviously leaves quite a lot of ambiguity as to how they determine that "fairest" time. Presumably because there's a lot of variables to consider. The NRS site gives some info as to how that might play out:
The officials of the event will say "Hey, how can we most fairly handle this?" And the key here is "most" fairly. Not perfectly fairly, but as fairly as is actually possible, since the only perfectly fair thing would be if the stage wasn't blocked at all, and you can't go back in time to make that not happen. The officials will look at the scores they have, and say "Ok, who was the last person that got through the stage that actually got a good shot at racing it?" In this case, that's car 5. That time is then assigned to all the cars that didn't make it through. After the adjustment, it looks like this:
1 - 6:45
2 - 6:52
3 - 6:58
4 - 6:57
5 - 7:03
7 - 7:03
8 - 7:03
9 - 7:03
10 - 7:03
6 - DNF
What this does is gives the cars that did race the credit for whatever time they earned. And for the cars that didn't get to finish the stage, since they all get the same time, as far as the overall race is concerned, they haven't moved up or back compared to any of the people they are racing.
The officials are generally clever when it comes to this analysis. So, if the last valid time is really slow and they find out that person stopped to fix a flat tire, they might use the next time up the list. Or they might split the adjustments based on AWD and 2WD if the conditions of the stage were very slippery. In all cases, the real problem is what happened out on the stage, and the officials are trying to adjust the scoring to make the remainder of the race as fair as possible.
If it's the first car that manages to crash and block the stage (so no-one has completed the stage) then it's easier, cancel the stage and everyone proceeds at liaison speed to the next stage.