Actually for all writers, of fantastic fiction, historical fiction, any kind of fiction whatsoever, I think writing what you know is good advice. The question is, what do you know about X? And the answer is, you need know a whole heck of a lot before you can write well about it. Which doesn't preclude a beginner from tackling the fantastic.
Sure, it may be easier for a new writer to use local settings, or to crib characters from family and friends (or enemies), or to use a story that is familiar. But many beginners learn successfully following the fan-fiction route -- having fully invested in the lives of characters others have created, they move them around like marionettes and flex their writing muscles that way. And there are some writers who just plunge into research like a seal into water. Or have built worlds since childhood. Or who have spent every moment since fifth grade imagining what it must be like panning for ingots during the Gold Rush.
"Write what you know" means to me that the writer really understands what is going on his her/his story -- all aspects of it. And that may mean creating a whole new universe. Or diving into the 19th century. And it definitely means that the characters have to make internal sense as people. To do that last bit, you have to know your character like yourself, or your mom, or your best friend, or whoever-real. But that character can be entirely invented, as long as you know her/him.
Limiting a writer to the ambit of her/his life may be a useful exercise. After all, getting to know your story, your characters, your setting -- that takes work. The advantage of starting with the familiar is that you don't have to invest as much time in that kind of work. But the work can also be accomplished while writing -- many authors don't know their characters, their setting, even their plots until after they've finished writing the story. But every successful one will tell you that once they're done, they do know -- they learn as as they go. And once the first draft is done, then the real writing begins, in the revisions. Because now they can write about what they really know.
Maybe the advice is too truncated. It should read, "Write until you've written something that you really know."