You rest the RNG before each of the two sets in first code segment but only at the beginning of the loop in the second so the two x1 sequences aren't the same.
No idea what the purpose of this might be for, but either
without changing the second code segment or
leaving the first unchanged will produce the same overall sequence of randn()
It makes no sense to me to do either in isolation here; I suppose there might be some situation this mimics that it would be a reason for one or the other cases this simulates.