In the section 3.2 of *Sheaves in Topology* by A. Dimca, the author explains that if $f:X\to Y$ is a continuous map (between locally compact, $\sigma$-compact topological spaces with finite homological dimension) such that $f_!$ has finite cohomological dimension, then the following holds:

>**(Verdier duality, local form)** There is an additive functor of triangulated categories $f^!:\mathsf{D}^+(Y)\to \mathsf{D}^+(X)$ such that there is a functorial isomorphism
$$\mathsf{R}\underline{\operatorname{Hom}}^\bullet(\mathsf{R}f_! \mathscr{F}^\bullet,\mathscr{G}^\bullet)\cong \mathsf{R}f_*\mathsf{R}\underline{\operatorname{Hom}}^\bullet(\mathscr{F}^\bullet,f^!\mathscr{G}^\bullet)$$
in $\mathsf{D}^+(Y)$ for any $\mathscr{F}^\bullet\in\mathsf{D}^b(X)$ and $\mathscr{G}^\bullet\in\mathsf{D}^+(Y)$.

Do we really need all those hypotheses? Perhaps we can use Brown's representability theorem to prove it under more general conditions for the unbounded derived category? (There's a post here on MO about using this theorem but there it is under *less* general conditions.)

**Edit:** Let me be clear about my "proposed" proof. Let $f:X\to Y$ be a morphism of (locally compact) ringed spaces and $\mathsf{D}(X),\mathsf{D}(Y)$ be their derived categories of modules. The tag 0F5Y on the Stacks Project implies that any triangulated functor $\mathsf{D}(X)\to\mathsf{D}(Y)$ which preserves direct sums has a right adjoint.

If we could prove that $\mathsf{R}f_!$ preserves infinite direct sums, then we would conclude the existence of a functor $f^!:\mathsf{D}(Y)\to\mathsf{D}(X)$ such that
$$\hom_{\mathsf{D}(Y)}(\mathsf{R}f_!\mathscr{F}^\bullet,\mathscr{G}^\bullet)\cong \hom_{\mathsf{D}(X)}(\mathscr{F}^\bullet,f^!\mathscr{G}^\bullet)$$
naturally in $\mathscr{F}^\bullet$ and $\mathscr{G}^\bullet$. This yields the local form as usual (for example, prop. 3.1.10 in Sheaves in Manifolds).