Its been a while and I'm writing from memory so happy to have clarifications.
There is a lot of circumstantial evidence that the CIA encouraged John Kerr to dissolve parliament. The US govt definitely didn't like Whitlam's foreign policy and wanted him gone. John Kerr was definitely in touch with the CIA and the director of the CIA called him "our man Kerr". It is also unprecedented before and since(unpostcidented?) for a governor general to dissolve parliament without advice from the PM nor did he seek advice from the queen. I believe, and I think it's a not uncommon opinion among serious historians, that there was some nudging from the CIA hoping that Whitlam would be ousted before the crisis could resolve itself with Whitlam retaining leadership and that things might've been different had the CIA not been subtly pushing their agenda.
Gillard's ousting I'm less familiar with and so I'm a bit lighter on the details. Again, the US definitely preferred her foreign policy stance and the party members who pushed for Rudd's removal had ties with the US. Maybe there was some nudging going on. I don't know enough to judge this one.
Both of these happened on a background of waning leadership of the leader and a viable, electable, alternative already in place. Ley is a joke, it would take more than a nudge from the CIA to get her in.
I'll sign off now feeling that I've sufficiently annoyed both sides.
*Edit - I totally agree that it is completely inappropriate for the opposition leader to be putting her policy to a foreign government rather than putting it to the electorate. Treason? Probably not, but a breach of protocol, definitely.