My take:
Gender politics resulted in not the best person being chosen for the job. 50% of the Cabinet is female but only 25% of the Liberal caucus being female means that the best were not selected.
She has a reputation for being opinionated. That she had 4 chiefs of staff is an indication.
The Attorney General is a politician, so it's naive to think that this office cannot ethically be influenced by the government of the day. Otherwise, the Attorney General would be an appointee bureaucrat.
As a cabinet member, you play ball with what the cabinet consensus, that is largely driven by the PM. You know what the government wants, and your influence as Attorney General is affected.
The Attorney General has discretion to stay a prosecution (in this case in favour of a civil penalty) if the interests of the country override principles of rule of law. In any case, the rule of law is based on legislation and legislation is what politicians make.
In this case, the government is concerned at the potential job loss if SNC cannot get work as a result of a conviction and either fails or downsizes. That's what politicians do: protect the public interest by promoting improvements in the economy.
I now suspect that Wilson Raybould rubber stamped the arrest and detention of the Huawei executive over the objections of the PM. Not a team player. That decision might have a big economic impact on Canadian jobs if we anger China enough, our second largest trading partner. Next, she is refusing to override the decision of the Prosecution service to prosecute SNC over the concerns of the PM. I think that enough was enough, and she was demoted because she didn't play ball.
Butts got the sack, not because he pressed Wilson-Raybould to change her mind, but because the matter got out of hand as a result of him not being able to give the proper advice and manage it. Plus, it was he who got her into federal politics specifically in order to put her in the cabinet.
What it boils down to is this: you won't win an election because you rigidly upheld the rule of law. But you will lose an election if enough people vote against the you because they lost their jobs. The government was right to wish that the prosecution not take place, but failed miserably to contain the damage.