I don’t see how they could have accidentally got into Iranian territory.
I have a refurbished Garmin in my car and it is never off, not even a hundred yards off. It even tells me if I turn and it tells me immediately.
I suspect the Navy has more than a $25 unit.
Even in the navy stupid stuff happens.......Several years ago a female naval officer lost her command after running her ship aground.