How does the halting theorem interact with the recursion theorem?
The recursion theorem states that for every two-place partially computable function $t$ there is a program $R$ which computes a partial function $r$ satisfying
$$ r(w) = t(\langle R \rangle, w) $$
for all $w$. The function $t$ is given by a program that doesn't necessarily halt, and so we can think of it as a function from $\mathbb{N}^2$ to $\mathbb{N} \cup \{ \bot \}$, where $\bot$ means that the program doesn't halt. We call such a function a partial function, since a different way of specifying such a function is as a function from some subset $S \subseteq \mathbb{N}^2$ to $\mathbb{N}$; the function doesn't halt on inputs outside $S$.

The equality $r(w) = t(\langle R \rangle, w)$ is an equality of partial functions: the functions have the same domain (or the same set of inputs on which the output is a natural number rather than $\bot$), and they agree on their domain.