This doesn't work. Mattis is not in poor standing with the Joint Chiefs and the standing Generals of the Army.
They'd have to take him down AND the entire JCoS and standing Generals. Do this, and the military would kick their teeth in.
What are they going to do in response to that, fight back and take down the president?
They just need a story that Mattis and the generals were plotting a coup and mandate their arrest.The goal is for the story to be credible, so that the counter-coup can occur even if there is no actual coup. This wouldn't be a military coup, it would be a judicial one. No shots fired, just confusion, arrests, resignation demands.
See how it would work in a country like Turkey where the government had control over the police, but not so much over the military until recently. The military were the protectors of the secular state, but Erdogan replaced its leaders with his own over time. How did that work? Because he had the control of the justice system, the police, which controls the population, and hence the politicians. No one could stand up and stop it.
Trump/Bannon don't need to fire a shot. Only impeachment stands in the way, and the Republicans might be too afraid of the impact on their future to act.
BTW, Trump's in charge of the NSA now.
I imagine at that point Congress would vote to remove him from power, and Pence along with him.
If Trump and Bannon arrested Mattis and took over the military in one night somehow? Of course. That's not what I described at all. Mattis and a few others would be removed and it would take some time for congress to figure out if the claims are true or not. For them to impeach Trump, they have to accept pretty much giving up on 2018, 2020 and maybe more. They would let Trump move ahead, always with the same idea that it will work out in their favor in the end.
If this happens during a big conflict, I would imagine they would replace Mattis and the generals without passing by congress at all. Already said any constitutional crisis favors Trump/Bannon, as it automatically turns into a matter of viewpoints, not facts.