This is one of the oldest writing cliches in the book. Write what you know. I've always had a pretty loose interpretation of this particular saying - in a sort of write what is honest and true to you rather than you may only write about your own areas of expertise and I still prefer that interpretation.
But... well, there's something to be said for experts. So, maybe I'll change this one up a bit and say, if you're going to write about something you don't know about, go for it! But please be edited by or beta read by someone who is an expert - because no matter how much research you do, you will get things wrong. Little things. Tiny things. But things that will make it clear you don't know what you're talking about.
I come across this most often in books about Alaska (moose don't come in herds, darlings) or Hawaii (there is no "b" in the Hawaiian language, so that island you just made up? Give it a different name), but my current Oh Dear is baseball. I'm a baseball junkie. I'm reading a really, seriously excellent romance that happens to feature a baseball player hero. And I'm loving it. Except when a sentence appears and my brain says to the author, "Oh no, you don't really know anything about this sport, do you?"
Catchers do not have "pinpoint control, commanding both sides of the plate"; pitchers do. RBIs are not an average, they are cumulative, so you would never say "an 120 RBI" (it's "120 Ribbies"). Your hero can't get a walk-off triple on a road game. Your starting pitcher can't "hold a save" in the seventh inning (or ever, saves are for closers). This extremely talented author is cribbing phrases from the right places, but applying them in just slightly the wrong way. Tiny little things. Tiny things that throw the in-the-know audience right out of the book.
Funny enough, I had a similar issue when I read the same author's book about a professional snowboarder. Loved the book, but kept getting thrown out by things that were just a tiny bit off. (The stuff about living in a snow culture was spot on, but he read like an alpine skier to me rather than a boarder.) It's a small thing (and god knows, it's hard to find an expert to beta read everything you write), but the devil really is in the details.
Of course, I cheat and write about paranormal worlds with shifters and psychics and demons and whatnot, where I get to just make everything up and I probably still get it wrong, so I'm not really one to talk. Kudos to those go for it.