A rival from the theater world might be responsible. This person could set Rachel up to look bad. For example, they plant some evidence on her to make it seem like she's involved in some illegal activity related to a show, leading to her arrest.
It could be an overzealous security guard. If Rachel was at a high - profile event and the security guard misinterpreted her actions as something threatening or against the rules, he could be the one to call the cops and get her arrested.
Perhaps in the fanfiction, Rachel is wrongly accused of stealing a valuable prop from the theater. She was just borrowing it for inspiration but there's a misunderstanding and she ends up getting arrested. Then she has to fight to prove her innocence.
Perhaps in the story, there was a misunderstanding about Sunshine's disappearance or harm. The authorities thought Rachel had something to do with it. Maybe Sunshine was missing before an important event and Rachel was the last person seen with her. The police misinterpreted the situation and arrested Rachel, even though she was innocent and was actually just helping Sunshine with some personal issues.
Well, obviously Rachel Berry and Sunshine. But also, other members of the glee club could be involved. For instance, Finn might try to defend Rachel, thinking she's innocent. Or Santana could be there, making sarcastic comments about the whole situation. Kurt might also be involved, perhaps using his connections to try and get Rachel out of jail. And of course, the adults in the story like Mr. Schuester could play a role. He might be shocked at first but then start to investigate to prove Rachel's innocence.
It could be Harry Potter himself. He has been a victim of her tyranny and might finally find a way to expose her once and for all.
The Ministry of Magic could be responsible. They might be jealous of Dumbledore's power and popularity. They could see him as a threat to their own authority and come up with some false charges to arrest him. For example, they could claim he was hiding information about a dangerous dark wizard.
Maybe a mysterious new character in the fanfiction. This character could be from Adrien's family's past, someone with a vendetta against his family, and decides to start by getting Adrien arrested to disrupt the family. For example, if Adrien's family wronged this character's family long ago, they see Adrien as a target to take revenge on the whole family.
Finn could be involved if the fanfiction wants to explore a relationship with him as the possible father. He was an important part of Rachel's life in the original series, and his reaction to the news would be significant.
It could lead to a major shift in the story and dynamics among the characters. Maybe the other characters would struggle to cope with the loss and it could change the entire tone of the fanfiction.
She could die in a car accident. Maybe she was driving to a big performance and got distracted by thinking about her career and future, and crashed. Another possibility is that she might have some sort of health issue that was never revealed in the show, like a heart condition that suddenly gets worse.
I'm not sure about the absolute best, but some popular authors in the Glee fanfiction community might be good places to start. You could look for authors who have a high number of views and positive reviews on fanfiction platforms. For example, some authors who have been writing Glee fanfiction for a long time and have a deep understanding of Finn and Rachel's characters are likely to create great stories.