It's no secret that writing a good fanfic involves a fair amount of research. This might be into a factual subject such as historical fishing techniques, or it might be into fictional topics such as the minutiae of a setting's internal timeline. In addition, many fan-favourite characters, such as L and Hermione Granger are exceptionally intelligent – in fact, I have seen it said that so many Marvel characters are described as being geniuses that genius no longer even really counts as a character trait. Lastly, writing fanfic can be a hobby of many people who have some brains and who feel that their intelligence is not put to its best use in other aspects of their life.
The end result of this is that many fanfics feature a lot of characters who are well-read, well-spoken and well-versed in the subject of the fic. This can lead to fics where everyone is suddenly an expert in the author's chosen field, or where everyone speaks with impeccable grammar. Therefore, this problem is especially severe when the author's chosen field is niche (I've read a fic where a bunch of contemporary American 14-year-olds knew the ins and outs of colour symbolism in flower arrangements) and when characters who would normally have a very casual way of speaking talk like they just swallowed an English textbook.
I like it when characters don't know everything. Now, some of you will be reading this and thinking about fics you've read where nobody tells each other anything and it's all a big mess of easily avoided problems. That isn't what I'm talking about. What I mean is that real people sometimes don't have the ability to look everything up, and sometimes they have to act on an imperfect understanding of the situatuon and their role in it. This is something missing from some fanfic, and it's something that I think more authors should work with.
It's important to bear in mind that the author and readers alike are both in a position very different to that of the characters. The author is writing as a hobby, and the audience is reading at their leisure. Even if the author or audience have constraints upon the time they have available to indulge this hobby, it is likely to be something along the lines of not wanting to stay up too late in case that makes it hard to get up to go to work the next morning. The characters, on the other hand, are likely to be under more pressure than this and may very well be in a life-or-death situation. Therefore, while the author is able to double-check any detail they are unsure about and the audience can ponder the predicament of the characters and debate what their next move should be in their free time, the characters themselves do not have this luxury and will often have to make quick decisions. This does not excuse authors who make all the characters act like imbeciles for the sake of moving the plot along, but it does at least provide mitigating circumstances for any character to occasionally make a wrong move.
It's also important to bear in mind that not everyone has a very good understanding of every topic. In fact, I would say that almost nobody has a very good understanding of more than a handful of topics. I have things I understand relatively well, and things in which I am almost totally ignorant, and I'm sure the same is true for you. I consider myself quite well-versed in history, especially military history, and I can casually rattle off information about the First World War that would be ridiculously obscure to most people. However, there are others who know more about computer coding, or sculpture, or any other topic than I could ever dream.
I'll give an example from Children of an Elder God, a crossover between Evangelion and the work of H.P. Lovecraft. It's a good fic in general, but what I specifically want to talk about is a line in the non-canon Christmas special. This is Shinji Ikari's explanation of Christmas: "Christmas celebrates some European Bodhisattva who used to give gifts to children on this day, so now everyone gives each other gifts in memory of him."
This is quite possibly my favourite line of dialogue in all of fanfic.
The observant will note that every single factual detail there is wrong. However, it is all consistent with the level of understanding one can reasonably expect of a Japanese boy trying to explain a Western tradition with a complex cultural and religious history. I'm twice Shinji's age, and I'm sure I would do no better if I had to explain a Shinto or Buddhist custom. Shinji doesn't really understand Christianity, so he interprets Jesus in the context of Buddhism (compare The Devil Rides Out, in which the Buddha is described by one character in equal but opposite terms). Further, he has conflated Jesus Christ with Santa Claus - logical, as both are connected to Christmas. And of course he has tied the whole thing to Europe rather than the Middle East, because whitey introduced Christmas to Japan, and where does whitey come from originally? Instead of a technically correct but overall uninteresting paragraph that could have been copy/pasted from an encyclopaedia, we have a situation in which a character being wrong is used to provide a unique charm to both that character and the scene overall.
So, next time you're writing a fic involving a niche topic or specialist subject, consider having some of your characters just be wrong. Not only will it make the dialogue feel more natural, but you can tailor it to each individual character as a means of characterisation. Someone who wouldn't know much about history could state a historical fact that "everyone knows" but which is actually false, or someone who doesn't know about art might confuse the names of two Renaissance painters. It happens all the time in real life, and it can help your readers connect that much more to the characters and the situations they're in.
Mind you, I could always be wrong.