You made a mistake in your definition of the Hamiltonian but I guess that's simply a copy-paste error. Regardless, using the Hamilton equations:
$$\frac{dH}{dt}=\frac{\partial H}{\partial t}+\frac{\partial H}{\partial p_i}\dot{p_i}+\frac{\partial H}{\partial q_i}\dot{q_i}= \frac{\partial H}{\partial t}-\frac{\partial H}{\partial p_i}\frac{\partial H}{\partial q_i}+\frac{\partial H}{\partial q_i}\frac{\partial H}{\partial p_i}=\frac{\partial H}{\partial t}$$
On the other hand, you have:
$$dH=\frac{\partial H}{\partial p_i}dp_i + \frac{\partial H}{\partial q_i}dq_i + \frac{\partial H}{\partial t}dt $$
But also, form the definition of the hamiltonian:
$$dH=\dot{q_i}dp_i + p_id\dot{q_i}-dL= \dot{q_i}dp_i + p_id\dot{q_i}-\frac{\partial L}{\partial q_i}dq_i-\frac{\partial L}{\partial \dot{q_i}}d\dot{q_i}-\frac{\partial L}{\partial t}dt$$
Identifying terms, we can find a third Hamilton equation (as well as the other two, but we already used them above):
$$\frac{\partial H}{\partial t}=-\frac{\partial L}{\partial t}$$
And from our first result:
$$\frac{dH}{dt}=-\frac{\partial L}{\partial t} $$
Which means that the time derivative of the Hamiltonian is only $0$ when the time partial derivative of the Lagrangian is $0$. Fortunately, this is often the case, as kinetic energy isn't explicitly time dependent, and most potentials you'll consider aren't either.