The excessive power of Shangguan Waner caused the emperor's panic.
In fact, as early as the reign of Wu Zetian, Shangguan Waner won the trust of Wu Zetian, so she was reused under Wu Zetian and became the prime minister of the dynasty. Although she is only a descendant of a guilty minister, this status has not affected her survival at all. She helped Wu Zetian deal with many difficult problems and went down in history.
However, Wu Zetian, her umbrella, cannot be an emperor all her life. After Wu Zetian abdicated, it was Li Longji's turn to be emperor. He knew that Shangguan Waner was a powerful minister of the imperial court and had great power. So Li Longji began to panic. He seized the words of Shangguan Waner and put her to death.
Secondly, Shangguan Waner is very honest and frank.
As we all know, Shangguan Waner is not only a talented woman, but also an upright woman. She is very principled and intelligent, which is not available to ordinary women. She is often outspoken, able to tell the disadvantages of some things, and is liked by Wu Zetian. But Li Longji didn't like it, so she may have said something about honesty and frankness, which annoyed Li Longji and killed her.