All of this lends itself to a theory posited on Reddit by MustanGuy Elsapowers were hidden not because of the danger she might pose to Anna but because of the reputation magic has in Disneys shared universe.
Having magical powers as the future Queen of Arendelle might lead her future subjects to mistrust Elsa or even revolt. In Frozen its shown what happens when she accidentally uses her powers at her coronation she is immediately called a sorcerer and when she flees is pursued by people seeking to kill her. Instead of merely being afraid of her powers or that she can not control them this theory proposes that her parents had some foresight or knowledge of the public opinion of magic. In locking her away they were trying to keep her safe from people who would assume her a villain merely because she has powers. This paints s parents in a wholly different light than what the film might suggest of them on a first watch.
This theory changes Elsa’s journey in the first Frozen movie dramatically. Instead of simply being a story of self-acceptance and growth its a story of changing a nations mind and breaking known conventions down so she can live authentically in a world that is unkind to her reality as a magic user. That she was born with her powers and did not seek them makes her very different than characters like Jafar Dr. Facilier or Ursula all of whom seem to be seeking power. Elsa is reluctant to use her powers because she has internalized this same fear that exists among the citizens of Arendelle magic is scary and bad. Overcoming those feelings and thoughts is something even grander than just coming to terms with herself and her truth Elsa is actively changing the status quo of Disney. Heroes can be magical and powerful and good all at the same time.
There are some key problems with this theory about Elsas powers in Frozen. While it has a nice ring to it and adds depth to Elsas struggle it hinges a lot on the idea that Disney movies share a universe. Easter eggs are fun and they litter Disney films but examining them through a lens that makes them plot bearing is perhaps overburdening what they are meant for fun reference to other works. Another issue with this theory is that Elsa freely uses her powers until Anna is hurt in the opening scenes of Frozen. This was not something done in secret. Frozen 2 shows her parents looking in on the two playing with Elsas magic and smiling. If her parents were aware of a public stigma against magic and used that as the basis for their decision to sequester Elsa away it does not quite follow that she was allowed free use of her magic until Anna was injured.