Why does the Hamiltonian of a Lagrangian that consists of only a coupled term become zero?

Let's say our Lagrangian looks something like this:

$$L = \int dz\, Q\cdot \dot{A},\tag{1}$$

where $$Q$$ and $$A$$ are two generalized coordinates and $$\dot{Q}$$ and $$\dot{A}$$ would be the respective time-derivatives. If I wanted to Legendre-transform this, then considering the conjugate momenta $$P_Q = \frac{\partial L}{\partial \dot{Q}} = 0\tag{2}$$ and $$P_A = \frac{\partial L}{\partial \dot{A}} = Q\tag{3}$$ the Hamiltonian becomes:

$$H = P_Q\dot{A}-L= \int dz\,\, Q\cdot \dot{A} - Q\cdot \dot{A} = 0.\tag{4}$$

Is this correct? What does that even mean for the physical system?

Recall that the purpose of the Legendre transformation from Lagrangian to Hamiltonian formalism is to bring the equations of motion on first-order form. This is where the Faddeev-Jackiw method is so much simpler [than the traditional Dirac-Bergmann analysis which OP just performed]: OP's Lagrangian $$Q\dot{A}$$ is already on first-order form $$p\dot{q}-H$$ if we identify $$q~=~A,\qquad p~=~Q,\qquad H~=~0~!$$ A vanishing Hamiltonian means that all phase space variables are constants of motion. It reflects the world-line (WL) reparametrization invariance of the action, cf. e.g. this & this related Phys.SE posts.