I can tell you that this is called demonym, but I don't know the answer to your question... The Wikipedia page has a long list of suffixes, but no rules:
https://en.m.wikipedia.org/wiki/Demonym
The answer is that many languages import their demonyms from different foreign languages. The reason for the inconsistencies is the different, unrelated sources for words.