Similar discrepancies can be seen in other noun groups, for example "a beer" is fine, "the wine" is fine, but "a wine" sounds weird.
For the cases where usage of the word as a noun isn't considered idiomatic, people usually say "a korean person" or "a german guy" or "british woman", etc.
There is a similar phenomenon with "a Jew", which was once common and where now most speakers would use "a Jewish person" (except, to some extent, for Jews using it as a self-description, although "I am Jewish" is more common than "I am a Jew", but their denotation is also different because the former foregrounds religious identification and the latter foregrounds ancestry or ethnic identification).
Apart from the "person-centered language" phenomenon that other people have mentioned, I think there's the closely related euphemism treadmill
https://en.wikipedia.org/wiki/Euphemism#Euphemism_treadmill
where even a completely neutral term may acquire a negative connotation because of its widespread use in a negative sense, or by people intending to give it a negative connotation. Or people may simply fear that a neutral term has acquired a negative connotation by recalling that it was widely used in the past.
As other commenters have pointed out, there are still demonyms which are common to use in the singular and their idiomaticity has tended to change (mostly in the direction of stopping).
Although I think there's an interesting phenomenon where new countries' demonyms feel plausible to me in the singular ("an East Timorese", "a South Sudanese", "a North Macedonian", "a Kosovan"/"a Kosovar"). It's hard to prove but I suspect that the relative novelty or unfamiliarity of these terms acts to alleviate speakers' internalized fear that they might inadvertently be using the same terminology that was previously used by xenophobes!
But I'm not totally confident in that.
It would be interesting to gather more data by surveying a lot of native speakers about a lot of demonyms and trying to quantify the possible influences of (1) familiarity, (2) phonology, (3) history of ethnic conflict, ...
Another one that feels kind of parallel is the arbitrariness in whether you use a definite article in the name of a country. For example, "the Sudan" and "the Ukraine" used to be very common in English but it's not unusual to see the country names without the article now. On the other hand, "the United Kingdom", "the Netherlands", and "the Maldives" are still always "the". This is different in other languages, where for example "Switzerland" is never "the" in English, but is always "the" in German ("die Schweiz"); "Japan" is never "the" in English, but is always "the" in Portuguese ("o Japão"), as is Brazil ("o Brasil"). It's challenging, though maybe not impossible, to give a clear account of the origins of all of these distinctions...
Edit: in Arabic, too, some countries are "the" and some aren't, but it also doesn't correspond with English practice.
Interestingly, the presence of articles is not actually mandatory, but adding them gives a more colloquial tone, whereas removing them provides a more formal tone, e.g. "China proibe bitcoin" reads like a news headline, whereas a person on the street might say "A China proibe o bitcoin".
I suspect this could be related to learning of word gendering, since communication with children is always colloquial, and article omission tends to only occur when there's an assumption of a minimum level of sophistication.
This observation more or less holds across the entire Portuguese vocabulary, so I think it's quite a different case from the historical analysis of the discrepancy between "american" vs "french" in english.
Meanwhile, the CPLP members are
"a República de Angola, a República Federativa do Brasil, a República de Cabo Verde, a República da Guiné-Bissau, a República da Guiné Equatorial, a República de Moçambique, a República Portuguesa [which is kind of cheating!!], a República Democrática de São Tomé e Príncipe e a República Democrática de Timor-Leste"
Even for Timor-Leste, one would still use the masculine article when speaking colloquially, e.g. "Onde é o Timor-Leste?"
As for what word is masculine or feminine, yeah, it's pretty arbitrary.
The China headline example actually has another wonky case: coin in portuguese (moeda) is feminine, yet "bitcoin" is masculine. Go figure!
I somehow picked up the gendering of that word somewhere despite not having set foot in Brazil for about a decade and consuming english media pretty much exclusively for the past two decades. My guess is maybe my brother mentioned it in passing. It's weird how sensitive to learning gendering of new words we portuguese speakers are.
It doesn't sound abnormal to call someone a Korean, or most of the 'an's. But it does to call someone a Chinese/Japanese, as it's only used in the adjective form. We used to have noun forms, but they were deemed offensive long ago - so I'm not sure what the correct way is today.
Maltese, Lebanese, Chinese, Japanese, Polish, English, French - AFAICT only used as adjectives.
Canadian, American, Mexican, German, Russian, Nigerian - adjective or noun.
I'm not even trying to touch on appropriateness, just the general rules on how words are used/spelled. Something about 'an' makes it sound natural to use as a noun.
When referring to someone other than the writer/speaker, some see them as problematic because they can be othering/dehumanizing, or they can suggest a (potentially incorrect and offensive to the subject) priority of the particular axis of identity.
Where we don't have a subject pronoun to which the adjective can be attributed, we would usually supply "person" or another noun referring to a kind of person ("A Japanese person told me...", "Any Chinese person would readily recognize the meaning of hundreds of kanji based on the influence of hanzi", "My friend married a Japanese woman", "My mother goes to a Chinese acupuncturist").
Which itself is weird, because most other countries we just suffixed - like Englishman, Chinaman(also now considered derogatory, I think), Frenchman, Irishman, etc. But I cannot recall ever hearing 'Japanman' or anything similar.
In any event - I wouldn't take this situation you're in as any slight or bias against any people - it's strictly to do with the English language and ese/ish demonyms.
https://en.wikipedia.org/wiki/Japanese_holdout
"Jungle Jap" would be extremely offensive if used by a non-Japanese person to describe a Japanese person today. Although I wasn't born yet, I think that was almost certainly already true in the 1970s.
There are a lot of cases in which people use disparaging group terms and slurs for themselves either as a joke or as a political statement (which is sometimes called "reclaiming" when done consciously and politically). For example, "nerd" is often disparaging but many of my fellow nerds would regularly call each other that in school, and the web comic SMBC routinely refers to its readers as "nerds" (and I don't think the term would be considered disparaging at all when used within the context of a technology-oriented site or forum). I don't think this is a very clever idea for commercial branding, since other people who are aware of the disparaging use might find the brand awkward or uncomfortable!
If my guess about that is right, then you could compare it (pre-WW2 only!) to "Aussie" and "Kiwi" (for Australians and New Zealanders), which nobody would say is "the" name for these groups, but which is also not an insult. Although this is complicated because these are, I think, also autonyms for these fellow English-speakers. Maybe another example is "frogs" for the French, which is mildly disparaging but usually not a horrible insult, at least in contexts that are otherwise respects.
Americans have had plenty of racist/hostile opinions against Mexicans or Russians, yet "a Mexican" or "a Russian" remains totally fine.
From the Wiki article on demonyms though, "Often, demonyms are the same as the adjectival form of the place, e.g. Egyptian, Japanese, or Greek."
I guess you'd also not say "I am a Japanese", but probably just "I am Japanese"?
For country names ending with "-ese", it's usually an insult to call someone "a" something, like: Chinese, Japanese, Lebanese, Portuguese, or Vietnamese.
With these countries, it sounds better to say "I am from X" or "I am X", such as "I am Japanese".
"Have you ever met a Sudanese?"
"She married a Senegalese."
?"He's a Guyanese."
To me the risk of an offensive or disparaging connotation appears especially with East Asian and maybe South Asian -ese terms, but probably not with African or South American -ese terms (and not for "an East Timorese", as I pointed out in another post). I think this connotation arose in English in the 20th century especially with East Asian demonyms, and native speakers may differ in our perceptions of how widely the connotation spread.
I think I favor the theory that someone else suggested in the comments here that the Japanese and Chinese were the only East Asians that most Americans were aware of in the past, and were subject to a lot of hostility and prejudice (both before and after the war), and that people at some point felt that the singular noun forms had acquired a possible interpretation as slurs because of the memory of this. That matches my understanding of "a Jew", which of course is the perfectly normal and traditional form in English, but which many non-Jews and plenty of Jews have become uncomfortable with as a singular noun.
There is "chino, japones, italiano, frances, aleman". Full of different Romance suffixes and we put functionality over ideology.
Too lazy to care, and the noun/adj. roots and suffixes go back to the Latin spoken since the Romans.
We have "ingles" and "britanico" too, yet no one would say a common used demonym can be racist.
Also, hey, any demonym can be used either as a noun or an adjective. Both for people and for things.