Why is there such confusion over a and an? [closed]
Questions of why about language can rarely be answered definitively, but rules can be misapplied even by native speakers when dealing with unfamiliar words or constructions.
The huge demand for English instruction is not always met with high quality instructors or textbooks. We have seen it asserted, for example, that the article choice is dependent on the head noun instead of the next word— thus an green apple. Incorrect or arbitrary rules such as these then get reinforced.
Some people confuse the rule as applying to spelling as opposed to pronunciation, producing an eucalyptus tree or a X-ray. When you couple this with confusion over y and its use as a vowel, an yearling is explainable.
Letters are not used to represent the same sounds in every language, and there is additional trouble when transliteration is involved. I have heard JSON pronounced something like /iːʒoʊn/, which I can imagine could inspire someone to use an.
Similarly, sometimes a word is substituted for a similar native word that would take a different article if it were an English word. In Spanglish you'll sometimes hear an estudent, instead of a student, because student is being partially substituted with the Spanish estudiante.
In some cases, there are multiple accepted pronunciations which would alter the choice of article, e.g. a SQL procedure vs. an SQL procedure. Various H words like hotel, historic, etc. would vary by accent.
Some people hypercorrect.