Let's talk about the problem that Lucasfilm has with Darth Vader.
Like Boba Fett, Darth Vader has become a meme-infused character due to fan enthusiasm born of his depictions in the Original Trilogy of films. In the first film, he was just a heavy for the film's actual villain: Grand Moff Tarkin. Aside from interactions with Obi-Wan Kenobi, he didn't exhibit the character that fans came to love from him yet. That arrived with The Empire Strikes Back, and his humanization came with Return of the Jedi.
The Expanded Universe is mostly to blame for turning Darth Vader into the meme monster that he's become, which fueled (and got fueled by) the Prequel Trilogy. Early on George Lucas hired people to write stories to expand the property, and stories featuring Darth Vader became and remained very popular due to audience demand. The result is what we've seen (post-Disney buyout) with the Darth Vader comics, where the Ascended Fans who went professional and now write as hired guns for Lucasfilm or one of its licensees give up the version of Vader that Rogue One summarized so succinctly in that now-famous sequence at the very end of the film.
I'm talking about this because, if you are at all serious about paying bills by writing fiction, then you're going to consider taking Work For Hire contracts. That's you as a hired gun, and you're not only following the orders of the paymaster, you're also using their material to do your work. You are using your skills as a creator to produce product that the paymaster owns, and (by default) get no residuals after the fact; if you do your part, you get paid and have something to point to for future Work For Hire contracts.
Yet you are on the hook, so far as the audience cares, for anything in that book. Just as R.A. Salvatore about having a moon dropped on Chewbacca in Vector Prime. It's one thing to get flak over something that is utterly yours. It's something else to get it when all you did was follow another's orders, which is what you're doing when you're writing Darth Vader.
The other problem comes from your hired gun status also. Be it writing a novel, a script, or whatever you're not the shot-caller; you have some wigging room, but you're still just someone else's tool used to make their vision happen. Sometimes that means you get stuck facilitating something that doesn't make narrative sense because it's good for business (such as all the Vader and Fett stuff), and it becomes your job to make it work as they intend- to use your creative skills to trouble-shoot their problem.
If you get a reasonable liason representing the property owner, this can be mostly painless; by all accounts, Christie Golden's relationship with Blizzard Entertainment was fantastic (she's now on the payroll as an employee) and Timothy Zahn continues to have a good one with Lucasfilm. Likewise, poor ones can be disastrous; bail as soon as you can and never go back.
So, if you get an opportunity to get hired to write sanctioned fan-fic for a property, don't turn it down out of hand; it worked well for Jon del Arroz, Jeff Grubb, Timothy Zahn, Richard Knack, R.A. Salvatore, and many others- Walter B. Gibson being the most successful example. Take the bad experiences as the cautions that they are, and watch for the red flags. Writer Beware, but Fortune Favors The Bold.