https://theinnisherald.com/the-other-once-upon-a-times-a-his...
https://theinnisherald.com/the-other-once-upon-a-times-a-his...
https://en.wikipedia.org/wiki/Legal_issues_with_fan_fiction
Fanfiction and fan art also tend to run afoul of the infrequently (but occasionally) litigated part of copyright - copyright of fictional characters.
https://en.wikipedia.org/wiki/Copyright_protection_for_ficti...
I came across this with the Eleanor lawsuits - https://www.caranddriver.com/news/a42233053/shelby-estate-wi... - and while I believe that that instance Eleanor falls on the "this shouldn't have been copyrightable" (took a bit to get there), the question is "what protects the representation of Darth Vader?"
In general it tends to be ignored and tacitly encouraged... but it isn't protected.