One way to fix it is to require, in effect, both manifolds to be locally homogeneous: For every pair of points $p\in M, q\in N$ there are neighborhoods $U_p, V_q$ of these points in $M, N$ respectively, so that $U_p$ is isometric to $V_q$.
Alternatively, require that a local isometry is given by a map $f: M\to N$ (but do not require a globally defined locally isometric map $N\to M$, only local maps). This is where compactness of $M$ and connectedness of $N$ will play role since such $f$ will be a surjective (even more, covering) map. This, however, sounds quite awkward.
One can make this exercise more presentable by writing something along the following lines.
In the literature, one frequently encounters two different notions of "local isometry" for Riemannian manifolds:
Definition A. A local diffeomorphism $f: (M,g)\to (N,h)$ between Riemannian manifolds is said to be a local isometry if $f^*(h)=g$. Accordingly, a manifold $(M,g)$ is said to be locally isometric to $(N,h)$ is there exists a local isometry $(M,g)\to (N,h)$.
Definition B. A Riemannian manifold $(M,g)$ is said to be locally isometric to a Riemannian manifold $(N,h)$ if each $p\in M$ has a neighborhood $U$ in $M$ such that $(U,g)$ is isometric to $(V,h)$ for some open subset $V\subset N$.
Clearly, if $(M,g)$ is locally isometric to $(N,h)$ in the sense of Definition A then it is also locally isometric to $(N,h)$ in the sense of Definition B, but the converse is false. Furthermore, neither of the definitions A and B defines a symmetric relation on Riemannian manifolds. However:
Exercise. 1. Suppose that $M$ is compact, $N$ is connected and $(M,g)$ is locally isometric to $(N,h)$ in the sense of Definition A. Show that $(N,h)$ is locally isometric to $(M,g)$ in the sense of Definition B.
- Assuming that $(N,h)$ is locally homogeneous, show that if $(M,g)$ is locally isometric to $(N,h)$ in the sense of Definition B then $(N,h)$ is locally isometric to $(M,g)$ in the sense of Definition B.
Edit. Another way to save the symmetry of the "locally isometric" relation is to weaken "maps" to "relations." More precisely:
Definition. Two Riemannian manifolds $(M_1,g_1), (M_2,g_2)$ are said to be weakly locally isometric if there is a surjective relation $R\subset X=M_1\times M_2$ such that the both projections $\pi_i: X\to M_i, i=1,2$, restrict to surjective local diffeomorphisms on $R$ and
$$
\pi_1^*(g_1)|_R= \pi_2^*(g_2)|_R.
$$
In other words, there exists a Riemannian metric $g$ on $R$ such that $\pi_i: (R,g)\to (M_i,g_i)$, $i=1,2$, are both surjective local isometries in the sense of Definition A. (The "surjective" part of the definition is optional.)