I do both, and it is difficult to switch gears. There are aspects of writing non-fiction that are different from writing fiction, so being good at one doesn't necessarily translate to being good at the other. In other ways, the two types of writing are identical and that makes doing both more difficult: if you've spent four hours at the keyboard writing one thing, it can be impossible to convince yourself to spend four hours at the keyboard writing something else, and one project or the other suffers.
Check out the thread on the 90 minute limit for writing, and consider whatever your natural breaking point is. Your body and brain won't necessarily cooperate if you explain that, "yeah, I did my limit of writing for the day, but now I'm going to do some more writing, except this is different."
Some people can do that. Eloisa James used to "reward" herself for writing academic stuff with an hour of writing fiction. Me, after several hours of freelance work, I'm just too burned out to do any more writing, even if it's a different type of writing. I do manage to do both, but it tends to be a feast-or-famine thing, and I don't do much fiction on days when I've done intense amounts of freelance work.
JD