I think there is a typo in Lemma 5.4.5.11: $K$ is supposed to be $\tau$-small and not $\kappa$-small. Note that if $\tau < \kappa$ and $K$ is $\kappa$-small but not $\tau$-small then the statement of the lemma is simply false: e.g., set $\mathcal{I}=\mathcal{J}=K=\mathbb{N}$ to be the poset of natural numbers (with arrows pointing from small numbers to larger numbers) and take both $f$ and $p$ to be the identity. Set $\tau=\omega$ and $\kappa$ an uncountable cardinal. Then $\mathcal{I}_{p/}$ is empty, and so certainly not $\tau$-filtered.
Note that the second statement in 5.4.5.11 is independent of this problem, and its proof does not use any size bound on $K$ (there is a small typo though in the first line of the proof of (2), "where $K$ is now $\kappa$-small and weakly contractible" -> $K$ should be $K'$.
Note also that 5.4.5.11 is cited two times in HTT, once in 5.4.5.12 and once in 5.4.6.5, but in both cases $K=\Delta^0$ and is in particular $\tau$-small.
The issue will hence in principle be resolved if we prove 5.4.5.11 under this modified assumption:
Proof of 5.4.5.11(1) when $K$ is $\tau$-small
Let $\tilde{q}:K' \to \mathcal{I}_{p/}$ be a $\tau$-small diagram classifying a compatible pair of maps $q: K' \to \mathcal{I}$ and $q':K \star K' \to \mathcal{J}$. Since $\mathcal{I}$ is $\tau$-filtered we can find an extension $\overline{q}:(K')^{\triangleright} \to \mathcal{I}$ of $q$. To facilitate notation later on let us write $L:= (K')^{\triangleright}$ and let $l \in L$ be the vertex corresponding to the cone point of $(K')^{\triangleright}$. Now $q'$ and $f\overline{q}$ combine to give a map $r:[K \star K'] \coprod_{K'}L \to \mathcal{J}$. Since $\mathcal{J}$ is $\tau$-filtered and $K, L$ are $\tau$-small we can find an extension of $r$ to a map
$$ \overline{r}:\Big[[K \star K']\coprod_{K'} L \Big]^{\triangleright} \to \mathcal{J} .$$
Let $x := \overline{q}(l)$ and $\alpha: f(x) \to y$ be the arrow corresponding to the restriction of $\overline{r}$ to $\Delta^1 = \{l\}^{\triangleright} \subseteq L^{\triangleright}$. Since $f$ is $\kappa$-cofinal there exists an arrow $\beta: x \to z$ in $\mathcal{I}$ and a map $\eta:\alpha \to f(\beta)$ in $\mathcal{J}_{f(x)/}$. Since the inclusion $\{l\} \subseteq L$ is right anodyne we have that $L\coprod_{\{l\}} [\{l\} \star \Delta^0] \subseteq L \star \Delta^0$ is inner anodyne and so may now extend the map $L\coprod_{\{l\}} [\{l\} \star \Delta^0] \to \mathcal{I}$ determined by $\overline{q}$ and $\beta$ to a map $\overline{q}_{\beta}:L \star \Delta^0 \to \mathcal{I}$. Next since $L \coprod_{\{l\}} \{l\}^{\triangleright} \subseteq L^{\triangleright} \subseteq \Big[[K \star K']\coprod_{K'} L \Big]^{\triangleright} $ is a sequence of an inner anodyne map followed by a right anodyne map we may extend the map
$$ \Big[[K \star K']\coprod_{K'} L \Big]^{\triangleright} \coprod_{L} [L \star \Delta^0] \coprod_{\{l\} \star \Delta^0} [\{l\}^{\triangleright} \star \Delta^0] = $$
$$ \Big[[K \star K']\coprod_{K'} L \Big]^{\triangleright} \coprod_{\big[L \coprod_{\{l\}} \{l\}^{\triangleright}\big]} \Big[\big[L \coprod_{\{l\}} \{l\}^{\triangleright}\big] \star \Delta^0\Big]\to \mathcal{J} $$
determined by $\overline{r}$, $f\overline{q}_{\beta}$ and $\eta$ to a map
$$ \overline{r}_{\eta}:\Big[[K \star K']\coprod_{K'} L \Big]^{\triangleright} \star \Delta^0 \to \mathcal{J} .$$
The restriction of $\overline{r}_{\eta}$ to $K \star K'\star \Delta^0$ and the restriction of $\overline{q}_{\beta}$ to $K'\star \Delta^0$ now determine an extension of $\tilde{q}:K' \to \mathcal{I}_{p/}$ to a map $K'\star \Delta^0 \to \mathcal{I}_{p/}$, as needed.