I compared two sets of data using KS-test. First set is empirical data X1 and the second is expected data X2 which is randomly sampled, normally distributed with mean $\mu$ and std dev $\sigma$.
The length of X2 is $10^6$. In the plot of their CDF, it looks like that both of them have similar distribution. When I did KS-test with X1 length is $10^3$, the result is H=0, which was correct.
However, when I tried KS-test with X1 length > $10^3$, I got wrong results (H=1), even though the plot showed that they belong to the similar distribution. I attached the plot here, when I got the wrong result. For the plot, I used X1 size=$10^6$ and X2 size=$10^6$. Empirical CDF in red, Expected CDF in blue. I used standard Matlab command (kstest2)
Is there any opinion related to this issue?