Warning: SPOILERS for WandaVision episode 5 - "On a Very Special Episode..."
Captain America: Civil War; in fact, it was Wanda's tragic mistake during an Avengers' mission in Lagos that prompted the United Nations to ratify the Accords in the first place. However, WandaVision's retcon makes it clear that international law enforcement views Scarlet Witch as a fugitive and enemy combatant, and not as a superhero justifiably gone rogue.
Unfortunately, Wanda's tenure as a member of the Avengers was a brief respite from her much longer career as a superhuman criminal. Maximoff and her twin brother Lagos (which WandaVision referenced with episode 5's commercial). From that point on, Wanda has been considered a terrorist in the MCU, especially since she refused to sign the Sokovia Accords and became a fugitive alongside Team Cap.
WandaVision episode 5, "On a Very Special Episode", hammered home Wanda's terrorist status during a S.W.O.R.D. briefing about Maximoff's activities as the "principal victimizer in the Westview Anomaly." Acting Director Tyler Hayward (Josh Stamberg) placed the blame squarely at Wanda for the events in Westview, New Jersey, and he showed news footage of Sokovia and Lagos with the chyron "Wanda Maximoff: Terrorist on the Loose." Captain Monica Rambeau (Teyonah Parris) tried to argue for Wanda's better angels and rejected the terrorist label, citing that Maximoff has no "political agenda or inclination towards destruction," which is the legal definition of a terrorist and is accurate in Wanda's case. However, Hayward countered with Rambeau's own testimony after Maximoff forcibly exiled her from her mind control; Monica called it "excruciating, terrifying, a violation" so Wanda is literally a terrorist for perpetuating terror.
Objectively, it's hard to argue with the perspective that Wanda Maximoff is a terrorist, although WandaVision is the first time it has been stated so bluntly. Even Secretary Ross (William Hurt), who was no great fan of the Avengers, didn't go so far as to designate Steve Rogers (Chris Evans) and his accomplices "terrorists" in Captain America: Civil War. Cap was labeled "a war criminal" by a gym teacher in Spider-Man: Homecoming but that was a throwaway joke. The public seemed torn about how to view the rogue Avengers after Civil War but law enforcement was clear about what to call and how to legally consider the Sokovia Accords' violators.
Since WandaVision takes place just a couple of weeks after Avengers: Endgame, it's possible Wanda never signed the Sokovia Accords even after she was brought back to life in the Blip and helped the Avengers: Infinity War.
Even if Wanda chose to sign the Sokovia Accords after her resurrection in the Hex. Without understanding or sympathizing with Wanda's grief, looking purely at her actions from a legal and law enforcement standpoint, it's clear why the MCU considers Scarlet Witch a terrorist in WandaVision.