The shah was the head of government Iran, not Mosaddegh. Mosaddegh sax appointed by the shah, not elected as prime minister. Pahlavi had the constitutional authority to dismiss Mosaddegh, and he was violating the Iranian constitution by going outside his authority.
It was not a coup. These are facts.