Why assume Turing machine can compute arbitrary results in Kraft-Chaitin theorem?
Let's take the example in which $n_i = i + 1$. In this case, we can choose the $i$'th program to be $0^i1$. Here is how the prefix-free Turing machine works. It reads the input, and determines $i$. Now it runs a Turing machine which enumerates the list $\langle s_j,n_j \rangle$ until it reaches $\langle s_i, n_i \rangle$, at which point it outputs $s_i$.

More generally, we choose the programs (i.e., the potential inputs to the prefix-free Turing machine) in such a way that we can effectively convert a program $p_i$ to an index $i$. In other words, contrary to what you write, the programs are not arbitrary, only their lengths are. In general the conversion from program to index might require partial knowledge of the sequence $n_i$.

The actual programs can be constructed greedily. See for example lecture notes of Satyadev Nandakumar, proof of Theorem 3.3.5.