She could be helped by the magic of the Encanto itself. Maybe the magic, which is a part of the family and the place, realizes that Abuela is wrong. So it could create some sort of distraction or even open a secret passage for Mirabel to escape. Also, the animals in the Encanto that Mirabel has a connection with could come to her aid. They could bring her tools or keys to unlock the door.
Mirabel could use her wits. Since she has a strong will and determination, she might find a weak point in the place of imprisonment. For example, if it's a locked room, she could search for a hidden key or figure out how to pick the lock.
Perhaps Abuela believes that Mirabel's presence without a gift is somehow jinxing the family's magic. In the fanfiction, she might think that by imprisoning Mirabel, she can stop the negative effects she thinks Mirabel is causing. This could be related to some superstitious beliefs within the Encanto about the balance of magic and the role of each family member.
One possible reason could be that Mirabel might have accidentally broken an important family heirloom. In the context of the Encanto family, their heirlooms are often tied to their magic and family identity. If she damaged something like that, Abuela, who is very protective of the family's traditions and magic, would likely punish her.
Perhaps she tries to understand Abuela's perspective. Mirabel is a kind - hearted girl, and she may think that there is a reason behind Abuela's actions. So she might try to see things from Abuela's point of view while still feeling the pain of the punishment.
Mirabel might be initially shocked and heartbroken. She loves her family and the village, so being banished would be a huge blow. She could cry and try to plead with Abuela to change her mind.
She might be heartbroken at first. After all, being kicked out by her own abuela is a big blow. But then she could become determined to prove herself. So she might set out to find a way to show that she is an important part of the family even without a magical gift.
One possible reason could be a misunderstanding. Maybe Abuela saw Mirabel doing something that she misinterpreted as a threat to the family or the magic. For example, if Mirabel was exploring a forbidden area in the house where the magic was acting strangely, Abuela might have thought she was endangering the family's future and thus imprisoned her out of fear.
In the fanfiction, Abuela may be under a lot of pressure to keep the family's magic and reputation intact. When something goes wrong that she blames on Mirabel, she kicks her out. Mirabel then has to face the outside world alone. She could encounter various challenges and adventures, which in turn make her grow. Eventually, she might find a way to reconcile with her family and even help save the family's magic in a new way.
At first, Mirabel might be shocked and confused. She would probably wonder why Abuela would do such a thing to her. She could spend her initial time in prison trying to figure out what she did wrong or if there was some mistake.
It could also be a misunderstanding. Maybe a magical accident occurs and Abuela wrongly blames Mirabel for it. Since the family's magic is so important to Abuela and the community, she might overreact and banish Mirabel without fully understanding what really happened.
Maybe she feels left out in the family. In the Encanto story, Mirabel is the odd one out not having a special gift. This could make her feel so alone and unwanted that she decides to run away.