What is it called when locals intentionally "mispronounce" (compared to the common or historical pronunciation) their home town or other words? I've read somewhere a while back that it was intended to know the difference between a local and a non-local person, e.g. someone who might not belong there.
Are you by any chance conflating the concepts of an endonym and a shibboleth?
Shibboleths are when the pronunciation of word distinguishes a 'non-local' from a 'local', and endonyms are an indigenous name or pronunciation, as opposed to the exonym used by outsiders. Neither word applies exclusively to placenames, but placenames are commonly examples of both.