The duty is that he is the commander in chief of the armed forces and giving orders to the military is a core presidential function.Depends. Official acts can be used to abuse power, sure. But these are functions of the Presidency as spelled out by the Constitution.
But ordering an extrajudicial killing of an American citizen does not fall under any Constitutional described Presidential duty.
The problem is will the eventual appeal to the SCOTUS about said act be ruled as an official Presidential duty? We know how they will rule for him.
Similarly, asking your vice president to stage a coup would not be a constitutionally described presidential duty but was explicitly called out as something he was immune for.
This ruling is not complicated. The president can kill anyone he wants.