Your boundary conditions do not correspond to reflective boundaries. Your $P(n,t)$ is the probability that, starting at time $0$ at some point $x_0$ in the set $I:=\{2,\dots,N-1\}$, the random walker stays in this set at all times $1,\dots,t$ and is at point $n\in I$ at time $t$. According to [Proposition 4][2], $$P(n,t)=\sum_{k\in\Bbb Z}(-1)^k P(S_t=x_k-x_0)=\frac1{2^t}\sum_{k\in\Bbb Z}(-1)^k \binom t{y_{t,k}},$$ where $S_t$ is the sum of $t$ independent Rademacher random variables (each of them uniformly distributed over the set $\{-1,1\}$), $x_{k+1}=2\alpha_k-x_k$ for $k\in\Bbb Z$, $\alpha_k:=N-x_0+k(N-1)$, $y_{t,k}:=(t+x_k-x_0)/2$. [1]: https://mathoverflow.net/questions/478019/probability-of-random-walk-on-confined-lattice-with-reflective-boundaries#comment1243619_478019 [2]: https://link.springer.com/chapter/10.1007/978-1-4612-1358-1_4