Let $\mathcal{B}$ be the collection of affine opens of $X$ which map into an affine open of $S$. For each $U$ we have a relative dualizing complex $(K_U, \xi_U)$ for $U$ over $S$. Namely, choose an affine open $V \subset S$ such that $U \to X \to S$ factors through $V$. Write $U = \Spec(A)$ and $V = \Spec(R)$. By Dualizing Complexes, Lemma \ref{dualizing-lemma-base-change-relative-dualizing} there exists a relative dualizing complex $K_A \in D(A)$ for $R \to A$. Arguing backwards through the proof of Lemma \ref{lemma-relative-dualizing-complex-algebra} this determines an $V$-perfect object $K_U \in D(\mathcal{O}_U)$ and a map $$ \xi : \Delta_*\mathcal{O}_U \to L\text{pr}_1^*K_U $$ in $D(\mathcal{O}_{U \times_V U})$. Since being $V$-perfect is the same as being $S$-perfect and since $U \times_V U = U \times_S U$ we find that $(K_U, \xi_U)$ is as desired. \medskip\noindent If $U' \subset U \subset X$ with $U', U \in \mathcal{B}$, then we have a unique isomorphism $\rho_{U'}^U : K_U|_{U'} \to K_{U'}$ in $D(\mathcal{O}_{U'})$ sending $\xi_U|_{U' \times_S U'}$ to $\xi_{U'}$ by Lemma \ref{lemma-uniqueness-relative-dualizing} (note that trivially the restriction of a relative dualizing complex to an open is a relative dualizing complex). The uniqueness guarantees that $\rho^U_{U''} = \rho^V_{U''} \circ \rho ^U_{U'}|_{U''}$ for $U'' \subset U' \subset U$ in $\mathcal{B}$. Observe that $\text{Ext}^i(K_U, K_U) = 0$ for $i < 0$ for $U \in \mathcal{B}$ by Lemma \ref{lemma-relative-dualizing-RHom} applied to $U/S$ and $K_U$. Thus the BBD glueing lemma (Cohomology, Theorem \ref{cohomology-theorem-glueing-bbd-general}) tells us there is a unique solution, namely, an object $K \in D(\mathcal{O}_X)$ and isomorphisms $\rho_U : K|_U \to K_U$ such that we have $\rho^U_{U'} \circ \rho_U|_{U'} = \rho_{U'}$ for all $U' \subset U$, $U, U' \in \mathcal{B}$. \medskip\noindent To finish the proof we have to construct the map $$ \xi : \Delta_*\mathcal{O}_X \longrightarrow L\text{pr}_1^*K|_W $$ in $D(\mathcal{O}_W)$ inducing an isomorphism from $\Delta_*\mathcal{O}_X$ to $R\SheafHom_{\mathcal{O}_W}(\Delta_*\mathcal{O}_X, L\text{pr}_1^*K|_W)$. Since we may change $W$, we choose $W = \bigcup_{U \in \mathcal{B}} U \times_S U$. We can use $\rho_U$ to get isomorphisms $$ R\SheafHom_{\mathcal{O}_W}( \Delta_*\mathcal{O}_X, L\text{pr}_1^*K|_W)|_{U \times_S U} \xrightarrow{\rho_U} R\SheafHom_{\mathcal{O}_{U \times_S U}}( \Delta_*\mathcal{O}_U, L\text{pr}_1^*K_U) $$ As $W$ is covered by the opens $U \times_S U$ we conclude that the cohomology sheaves of $R\SheafHom_{\mathcal{O}_W}(\Delta_*\mathcal{O}_X, L\text{pr}_1^*K|_W)$ are zero except in degree $0$. Moreover, we obtain isomorphisms $$ H^0\left(U \times_S U, R\SheafHom_{\mathcal{O}_W}(\Delta_*\mathcal{O}_X, L\text{pr}_1^*K|_W)\right) \xrightarrow{\rho_U} H^0\left((R\SheafHom_{\mathcal{O}_{U \times_S U}}( \Delta_*\mathcal{O}_U, L\text{pr}_1^*K_U)\right) $$ Let $\tau_U$ in the LHS be an element mapping to $\xi_U$ under this map. The compatibilities between $\rho^U_{U'}$, $\xi_U$, $\xi_{U'}$, $\rho_U$, and $\rho_{U'}$ for $U' \subset U \subset X$ open $U', U \in \mathcal{B}$ imply that $\tau_U|_{U' \times_S U'} = \tau_{U'}$. Thus we get a global section $\tau$ of the $0$th cohomology sheaf $H^0(R\SheafHom_{\mathcal{O}_W}(\Delta_*\mathcal{O}_X, L\text{pr}_1^*K|_W))$. Since the other cohomology sheaves of $R\SheafHom_{\mathcal{O}_W}(\Delta_*\mathcal{O}_X, L\text{pr}_1^*K|_W)$ are zero, this global section $\tau$ determines a morphism $\xi$ as desired. Since the restriction of $\xi$ to $U \times_S U$ gives $\xi_U$, we see that it satisfies the final condition of Definition \ref{definition-relative-dualizing-complex}.