The empirical approach.
Let the erroneous algorithm be implemented in Mathematica:
p = 10; (* Range *) s = {} For[l = 1, l <= 30000, l++, (*Iterations*) a = Range[p]; For[k = 1, k <= p, k++, i = RandomInteger[{1, p}]; temp = a[[k]]; a[[k]] = a[[i]]; a[[i]] = temp ]; AppendTo[s, a]; ]
Now get the number of times each integer is in each position:
r = SortBy[
We take three positions in the resulting arrays and construct a frequency distribution for each integer in this position:
For position 1, the frequency distribution:

For position 5 (middle)

And for position 10 (last):

and here you have a distribution for all positions built together:

Here you have the best statistics on 8 positions:

Some observations:
- For all positions, the probability of "1" is the same (1 / n).
- The probability matrix is ​​symmetric with respect to the large antidiagonal
- So, the probability for any number in the last position is uniformly (1 / n)
You can visualize those properties that look at the beginning of all lines from the same point (first property) and the last horizontal line (third property).
The second property can be seen from the following matrix representation example, where the rows represent the positions, the columns represent the passenger number, and the color represents the experimental probability:

For 100x100 matrix:

Edit
Just for fun, I calculated the exact formula for the second diagonal element (the first is 1 / n). The rest can be done, but it's a lot of work.
h[n_] := (n-1)/n^2 + (n-1)^(n-2) n^(-n)
Values ​​verified from n = 3 to 6 ({8/27, 57/256, 564/3125, 7105/46656})
Edit
By developing a slightly general explicit calculation in @wnoise's answer, we can get a little more information.
Replacing 1 / n with p [n], so the calculations are not evaluated, we get, for example, for the first part of the matrix with n = 7 (click to see a larger image):

which, comparing the results with other values ​​of n, we define some known integer sequences in the matrix:
{{ 1/n, 1/n , ...}, {... .., A007318, ....}, {... .., ... ..., ..}, ... ...., {A129687, ... ... ... ... ... ... ..}, {A131084, A028326 ... ... ... ... ..}, {A028326, A131084 , A129687 ... ....}}
You can find these sequences (in some cases with different signs) at the wonderful http://oeis.org/
Solving a common problem is harder, but I hope this is the beginning