First of all, the canonical Hamiltonian in classical mechanics and (or the canonical stress-energy tensor in classical field theory) is usually not necessarily gauge invariant.
For example, the Hamiltonian for an electron of mass m and charge e in an exterior electromagnetic field is
$$H=\frac{1}{2m}(p-(e/c)A)^2+e\varphi,$$
which is clearly not gauge invariant. The reason is that the exterior electromagnetic fields in the Lagrangian appear as non-dynamical variables.
Second, the transformation
$$L'=L+ \frac{dF}{dt}$$
you mentioned in your question is not a gauge transformation. A Lagrangian is always determined up to a total derivative, but it should be invariant under gauge transformations.
When talking about symmetries in classical mechanics and classical field theory, one must distinguish two types of "symmetries": Physical Symmetry (dynamical) and Gauge Redundancy (non-dynamical). Gauge redundancies arises from one's freedom of making choices of the way he may formulate the action. In the Langrangian formalism of classical field theory, one usually finds gauge regandancies when there are non-dynamical variables. For example, in classical electromagnetism, $A_{0}$ component is not dynamical because the Lagrangian density does not depend on its time derivative $\dot{A}_{0}$. Another example is the worldsheet metric tensor in string theory. In other words, by the implicit function theorem, one cannot find the corresponding canonical Hamiltonian via the Legendre transformation because the Hessian
$$\frac{\partial^{2}L}{\partial\dot{q}^{i}\partial\dot{q}^{j}}$$
is a singular matrix.
In your case, you should not call the transformation a gauge transformation. But if you are interested in gauge redundancies in your Lagrangian $L(x,\dot{x},t)$, then you must treat the variable $t$ as a separate non-dynamical variable. Then, the naive Hamiltonian
$$H=\dot{x}p-L$$
you gave does not make any sense at all. This is because the action
$$S[q(t)]=\int_{a}^{b} dtL(q,\dot{q},t)$$$$S[t,q(t)]=\int_{a}^{b} dtL(q,\dot{q},t)$$
now possesses a reparameterization invariance of $t$, which is clearly a gauge redundancy. To be specific, one can check that under a reparameterization of the variable $t$ which leaves the end points $t=a$ and $t=b$ fixed, the action becomes
$$\delta S[q(t)]=\int_{a}^{b}\left(\frac{\partial L}{\partial\dot{q}}\dot{q}-L\right)\delta tdt.$$$$\delta S[t,q(t)]=\int_{a}^{b}\left(\frac{\partial L}{\partial\dot{q}}\dot{q}-L\right)\delta tdt.$$
The above integral must vanish for arbitrary $\delta t$ that is fixed at $t=a$ and $t=b$, thus
$$H=p\dot{q}-L\equiv 0.$$
Thus, the naive canonical Hamiltonian vanishes identically. Note that the above naive Hamiltonian vanishes whether or not the action is extremized, which means that it is a mathematical identity that holds also off-shell.
An example of such a case is given by the geodesic of a Riemannian manifold, when parameterized by $q^{0}\equiv t$. The time variable $t$ becomes non-dynamical, and the Lagrangian explicitly depends on $t$ via the metric tensor $g_{\mu\nu}(t,q^{1}(t),q^{2}(t),q^{3}(t))$.
In your case, the canonical momentum $\pi$ of variable $t$ vanishes, but the Hessian has an invertible block
$$\Lambda_{ij}=\frac{\partial^{2}L}{\partial\dot{q}^{i}\partial\dot{q}^{j}}.$$
In principle, one can solve $\dot{q}^{i}$ in terms of variables $t$, $q^{i}$, $\pi$, and $p_{i}$. Plugging these solutions back into the definition of the canonical momenta, one can solve $\dot{q}^{i}$ in terms of $t$, $q^{i}$, $\pi$, $p^{i}$, and obtain a constraint equation on the phase space:
$$\phi(t,q,\pi,p)=0.$$
This means that the naive canonical variables $\left\{t,q,\pi,p\right\}$ on the phase space are not indepentindependent. This is known as the constraint system which was studied by Dirac. The physical phase space (reduced phased space) should be gauge fixed, and even dimensional.