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.
The functor $f_!$ preserves finite direct sums (lemma 6.11(a) in Spaltenstein's paper). As arbitrary direct sums are filtered colimits of finite direct sums, $f_!$ should preserve these as well. But direct sums in $\mathsf{D}(X)$ are obtained termwise (tag 07D9 of the Stacks Project), provingIf we could prove that the functor $\mathsf{R}f_!:\mathsf{D}(X)\to\mathsf{D}(Y)$ also$\mathsf{R}f_!$ preserves infinite direct sums. We, 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). Please let me know if there's something wrong with it.