(Disclaimer: it seems long but I specified all the needed details and the question is actually very quick)
Consider the following controlled system of ODE's
\begin{equation}
\left\{\begin{array}{l}
y^{\prime}(t)=f(y(t), u(t)), t>0 \\
y(0)=x \in \mathbb{R}^n
\end{array}\right.
\end{equation}
where
$u \in \mathcal{U}=\{u:[0,+\infty) \rightarrow U$ measurable$\}$, $U \subset \mathbb{R}^n$, $f: \mathbb{R}^{N} \times U \rightarrow \mathbb{R}^{N}$. Assume that the system is well-posed.
The problem is to minimize a functional $J$. To this porpuse define the value function
\begin{equation}
V(x)=\inf_{u \in \mathcal{U}} J(x, u) = \inf_{u \in \mathcal{U}} \int_{0}^{+\infty} e^{-\lambda t} f^0(y_x(t), u(t)) d t
\end{equation}
where
$\lambda>0$ is a discount factor and $f^0$ is regular enough.
In this setting following the dynamic programming approach one introduces the HJB equation:
\begin{equation*}
\lambda v(x)-H(x, \nabla v(x))=0 \quad \text { in } \mathbb{R}^{n}
\end{equation*}
where $H(x, p)=\inf _{u \in U}\{f(x, u) \cdot p+f_0(x,u )\}, x,p \in \mathbb{R}^{n}$
and one wants to how that $V$ is a solution of the HJB (which is not kwown a priori). To this porpuse see for example [Bardi, Martino, and Italo Capuzzo-Dolcetta. Optimal control and viscosity solutions of Hamilton-Jacobi-Bellman equations. Springer Science & Business Media, 1997.].
Assume now that the problem is to maximise $J$ (instead of minimizing as before), i.e. \begin{equation} V(x)=\sup_{u \in \mathcal{U}} J(x, u) = \sup_{u \in \mathcal{U}} \int_{0}^{+\infty} e^{-\lambda t} f^0(y_x(t), u(t)) d t \end{equation} Then maximising $J$ is equivalent to minimizing $-J$, i.e. \begin{equation} V(x)=\inf_{u \in \mathcal{U}} -J(x, u) = \inf_{u \in \mathcal{U}} \int_{0}^{+\infty} e^{-\lambda t}[- f^0(y_x(t), u(t))] d t \end{equation} so that the HJB should be the following: \begin{equation*} \lambda v(x)-H(x, \nabla v(x))=0 \quad \text { in } \mathbb{R}^{n} \end{equation*} where $H(x, p)=\inf _{u \in U}\{f(x, u) \cdot p-f_0(x,u )\}$.
The problem is that in literature the HJB related to maximisation problems is \begin{equation*} \lambda v(x)-H(x, \nabla v(x))=0 \quad \text { in } \mathbb{R}^{n} \end{equation*} where $H(x, p)=\sup _{u \in U}\{f(x, u) \cdot p+f_0(x,u )\}$.
But $$\inf _{u \in U}\{f(x, u) \cdot p-f_0(x,u )\} \neq \sup _{u \in U}\{f(x, u) \cdot p+f_0(x,u )\}$$ Why is that? Am I missing something?
You're missing an extra minus sign, you really have
$$V(x) = - \inf_{u\in U} -J(x,u).$$