I've never seen anyone claim about Harry Potter "Schools of magic don't work like that!" And 50 Shades is sex fantasy, which has never had that much to do with reality.

1. When you bring magic into a story, then the way it works should be consistentand logical in itself, and NOT poor man's deus-ex-machina.
As for magic schools: there actually ARE different systems of belief why and how it works; google: hermetic magic, chaos magic, alchemy, shamanism, vicca, voodoo etc. Some knowledge about mythology, ancient religions and mythical creatures doesn't hurt either. The Potter books are a brilliant example how to fail here.

50 Shades: unlike the previous example this is one I haven't read myself but as far as I understand it it's a case of writing about BDSM whilst knowing chickenshit about it.
BDSM itself isn't fictional, thus proper research on what, how, (and from psychological POV why) should have been undertaken by the author.

I find it so frustrating when an author clearly does not understand something (but writes as a supposed "expert") that I won't finish the book.

For instance, an automatic revolver. (Yes I know about the Webley-Fosbery but the author didn't.) A shotgun bullet. Scuba divers breathing oxygen. Gelignite being exploded by shooting it. Parachutes that open when jumping off a twenty story building. People in a matter of seconds breaking into and hot-wiring a car that has an engine immobiliser as standard equipment. (A modern Porsche.) A classic was a writer who wrote spy story where the protagonist attached a magnetic mine to a well know Presidential yacht. The yacht in question was made of wood. The same author had a protagonist using Scuba equipment thirty years before it was invented. Another had WW1 soldiers using walkie-talkies.

I could give examples all day of people writing about things that they don't anything about. Far too many writers do no research at all.

Exactly what I meant
Another well known example is (ok it's a movie but it fits) the Matrix scene showing a traceroute running with net adresses resolved to numbers <255

[...]
50 Shades: unlike the previous example this is one I haven't read myself but as far as I understand it it's a case of writing about BDSM whilst knowing chickenshit about it.
BDSM itself isn't fictional, thus proper research on what, how, (and from psychological POV why) should have been undertaken by the author.

Did you feel the slightest twinge of irony as you wrote the combination of words that I highlighted above?

Rather not clearly phrased by me (english is only the 3rd best language of mine) so I'll do my best now to clarify: my usage of "as I understand it" was directed towards "case of" writing about a topic unknown to the author in general and not towards "detailed bits of 50 S".
As the discussion about said book on MR pointed to a great source of reviews and some pointed out an ignorant treating of the topic (e.g. examples of unsecure uses of aids commonly used in BDSM play) I took this as 3rd person (reviever) proven not needed to be discussed again.
Insofar I admit that I should have added "As reported by reviewers" were I addressing this point in particular.
Rereading my post I should have written "As far as I understand, it's a case of (...) as pointed out in several reviews" Please accept excuses and correction.
Unfortunately I omitted focusing my response on

Quote:

It's a sex fantasy

The point I wanted to make was that, because BDSM as such is reality excuses from research based on the plot's fictional character didn't apply.

Rather not clearly phrased by me (english is only the 3rd best language of mine) [...] Please accept excuses and correction. [...]

I was mostly having fun (I should have added a smiley) ... though I do find it difficult take seriously the second or third hand criticism of another's work.

But as I write this I am reminded that, for many years, I thought "The Simpsons" was the worst sort of kids entertainment possible - and said so on more than one occasion. But when I finally got around watching a whole episode (the one with the family hooked up to buzzers attached to each other) I had great fun and soon became hooked. Now Simpson's quotes come to me in all sorts of, often inappropriate, moments.

And does that little homily have any relevance to the topic? Sure. Write what you know - or perhaps more appropriately: Don't write what you don't know - applies especially to criticism. As the first response to the OP stated: Do the research. If you don't know what you're writing about it could be that you are mistaken.

Coming back to the question, re: “Write what you know” - this is the biggest myth of all. Okay, so John le Carre was a real life spy. And he tells a mean, if wordy, spy story. But Tom Clancy was an insurance salesman. Then he goes and writes The Hunt for Red October. Somehow I don’t think Clancy was writing policies on secret Soviet submarines.