But we have to remember, Wanda has always been on the fringe.
We first see her working with Hydra because of what happened to her parents. She chooses to join the Avengers, but loses her brother. She tries to help others, and save her friends in Civil War, but gets painted as a villain for the collateral damage and placed on house-arrest by Tony. Then she chooses to join Hawkeye to help Cap, despite her feelings for Vision (and literally puts him in the ground)...gets labeled as a criminal again, and goes on the run with Vision at the beginning of Infinity War. Then she gets pulled back into the fight again, but has to kill Vision to stop Thanos...which he immediately undoes to get the Infinity Stone anyway. At end of the war, she's alone and hurting.
In WandaVision, we start out seeing a playful version of her powers and her ability to alternate reality. She re-creates her own version of Vision, and her children, to give herself the family she longs for. But her dark side comes out, we see glimpses of it throughout the series: when she's confronting the troops outside the town, hearing from the Westview residents trapped in her mind-control, even her arguments with Vision over how she controls him. Eventually, her creation comes crashing down. We see her flirt even more with the 'dark side' going against Agatha...as she's enticed to use her power. She lets Vision pull her back to her humanity, and feels remorse for what she did to Westview. Yet at the very end of Wandavision, we see her going to the dark magic to find her children.
To me the storyline of her going down the path with the Darkhold is perfectly logical. It simply took her to a much darker place than we saw in the glimpses from Wandavision. I thought it was well done. Her character arc is by far my favorite of all the 'second tier' MCU characters. I really hope her story doesn't send with Multiverse of Madness, and we see her character restored at some point. And Agatha definitely needs to come back...