By definition, science fiction is allowed to take liberty in science. If that liberty is extended to anything, then the story loses all structural credibility.
No, that's absolutely not how it works. There's a huge, huge difference between engaging in plausible and informed extrapolation from known science -- the kind of hard science fiction I write -- and just making up random gibberish that would flunk a 3rd-grade science test. Science fiction is not a license to be lazy or ignorant. It demands
more research from the writer, not less, because the audience is savvy enough to recognize the mistakes.
Taking liberty the
right way is to propose something unreal but to keep everything around it as plausible and accurate as possible -- for instance, propose an impossibility like faster-than-light drive but otherwise apply accurate physics to calculate how things would realistically behave
if that one thing were possible, or depict an irregular courtroom procedure but work with legal consultants to find an argument or precedent that just might make it remotely possible that a judge would okay it. There are ways to fudge things intelligently, so that an informed audience knows you're doing it by choice rather than out of ignorance or laziness. Taking liberty the
wrong way is just not bothering to do your homework and getting things wrong because you just don't know or care what you're doing. The two could not be more profoundly different. There's a difference between, say, a movie that's set in Paris and takes care to research its geography and architecture and culture but takes the liberty of postulating that there's actually a secret spy headquarters right under the Eiffel Tower, and a movie that's set in Paris but claims it's the capital of India and is across the Thames from Mt. Kilimanjaro. A lot of the nonsense in supposedly science-fiction TV shows and movies falls into the latter category, and it is
not the same thing as the liberties taken by an intelligent and well-researched work. The former is
The Martian making Mars windstorms a lot more powerful and noisy than they really are for dramatic effect while otherwise getting almost everything right; the latter is
Total Recall having people's faces blow up in the Martian atmosphere and claiming the planet has a core made of ice. Huge, huge difference.
All fiction is about bending reality, making things work differently than they do in real life -- more dramatically, more linearly, more consistently, more dangerously, whatever. But what matters is how effectively you sell the illusion. If you're lazy and just don't bother to make it make sense, then any savvy audience member will see through it. If you do your due diligence, research the things you need to research, and make your departures from reality as minimal and as convincing as you can, then even audience members who do see the artifice will still understand that you know what you're doing.
And the science fiction audience is generally a lot sharper and harder to fool than a lay audience. Hal Clement liked to say that writing hard SF is a competition between the writer trying to convince the readers an unreal idea is plausible and the readers trying to spot the flaws in the illusion. So you have to know your stuff -- make as few departures from reality as you can, and make them sound credible enough that the audience is willing to believe they might just be possible.