In Professor Lee's Introduction to Riemannian Manifolds, second edition on page 12, the first paragraph on Isometries reads
Suppose $(M,g)$ and $(\tilde{M},\tilde{g})$ are Riemannian manifolds with or without boundary. An isometry from $(M,g)$ to $(\tilde{M},\tilde{g})$ is a diffeomorphism $\phi\colon M\to\tilde{M}$ such that $\phi^*\tilde{g}=g$. Unwinding the definitions shows that this is equivalent to the requirement that $\phi$ be a smooth bijection and each $d\phi_p\colon T_pM\to T_{\phi(p)}\tilde{M}$ be a linear isometry.
Only one part of a proof eludes me. That is, given a smooth bijection $\phi$ such that each
$d\phi_p\colon T_pM\to T_{\phi(p)}\tilde{M}$ is a linear isometry, I haven't been able to prove that $\phi^{-1}$ is smooth if $M$ has nonempty boundary. When $M$
has no boundary, I can use his Introduction to Smooth Manifolds, second edition (ISM)
Proposition 4.8(a) and ISM Exercise 4.9 to get that $\phi$ is a local diffeomorphism
and ISM Proposition 4.6(f) to get that $\phi$ is a diffeomorphism. ISM Proposition 4.8(a)
relies on the Inverse Function Theorem for Manifolds (ISM Theorem 4.5) which
Professor Lee warns us "can fail for a map whose domain has nonempty boundary."
Is a map with invertible differential that maps boundary to boundary a local diffeomorphism? might be part of an answer if I could prove that $\phi$ mapped the boundary of $M$ into the boundary of $\tilde{M}$. (I can already prove that it maps the interior of $M$ into the interior of $\tilde{M}$ using ISM Problem 4-2.) Of course, such a requirement is necessary for $\phi$ to be a diffeomorphism by the Diffeomorphism Invariance of the Boundary Theorem (ISM Theorem 2.18), but I haven't been able to prove that $\phi$ maps boundary to boundary either.
So, how can $\phi^{-1}$ be proven to be smooth, or is the statement in the book incorrect?