@neohysteria
@xieliansbignaturals
It's mostly to do with some famous authors & copyright holders coming after fanfic writers in the past. Some still do.
If you're not profiting from writing fanfic, they have less of a case.
I don't know why they've targeted fic authors more than fan artists. 🤷
To protect AO3 against potential lawsuits, you can't mention that you're open to fic commissions there.
Anywhere else, you take your chances & hope the copyright holders don't notice or care