I think it is also important to consider, what a Jedi is supposed to do with Vader, if they are not allowed to kill their enemy once defeated. Particulary in the situation, where there is no option to bring him to justice, since the Emperor controls all branches of government. ROTJ makes it clear, that Obi-Wan and Yoda don’t believe Vader can be redeemed, so how is Luke supposed to stop/conquer them, if he cannot kill them? So, let’s for the sake of argument say Luke defeats Vader and the Emperor, and they are at his mercy. What then?
I’ve given this topic a lot of thought lately, and I think that fundamentally, it’s always a question of context. While I believe that the Jedi code would disapprove of killing a defeated enemy in all but the most extreme circumstances, the fact that Yoda challenges Sidious with the full intention of killing him seems to show that certain circumstances do exist that would allow a Jedi to execute their foe. But a Jedi can never strike down an enemy out of fear or anger/hate. And in the context of RotJ, I actually do think the strength of the Rebellion finally allows Luke the possibility of imprisoning the Emperor and/or Vader, a possibility that no longer existed for Yoda. So I think Luke striking down Vader and the Emperor would have been motivated entirely by his own fear or anger, and that’s exactly what he was struggling with during the entire throne room confrontation. I think that’s why Lucas makes it clear that the optimistic side of Luke believes that the Empire ends today with or without his involvement, and that he has to fight the nagging fear that he may be wrong (and should kill the Emperor to prevent the loss of the fleet). I think it would have taken the defeat of the Rebel fleet to bring the possibility of actually executing the Sith into the realm of being defensible, but even then, the only way Luke could do that without falling to the dark side is if it wasn’t motivated by fear.
So to answer your question, I could conceive of an alternate reality where after Luke fully achieves Jedi status, the Emperor manages to fend off Vader’s attack and kills him. Let’s imagine Luke would recover his lightsaber to defend himself from the Emperor, and soon after, Luke can see that the Rebel fleet is routed in retreat. Would Luke strike down the Emperor after defeating him and would it be justified? I think the answer could be yes to both, but only if the execution came from a place of serenity, which wouldn’t be a trivial thing for Luke to achieve in that moment. And even if he went through with it, I could see him being burdened by uncertainty about what he had done.
Tangentially, when it comes to how Obi-Wan and Yoda view the situation, I think there’s nuance that tends to be overlooked by fans who think that they’re essentially sending Luke on an assassination mission. It’s fair to say that Obi-Wan and Yoda have lost hope that Vader can be redeemed at this point, but I don’t think that means they think that Luke has to kill him at all costs. I like to frame it this way, do fans really believe that when Luke is standing over Vader, that Obi-Wan and Yoda want Luke to kill Vader in that moment? If that were the case, then why is that what the Emperor wants Luke to do? Instead, Luke throws down his lightsaber and declares that he’s a Jedi. That’s what Obi-Wan and Yoda want him to do, because they’re Jedi themselves. Not fallen, corrupted Jedi who have lost their way, but true Jedi. It’s what Yoda knew Luke had to do before becoming a Jedi like them; that’s what the conversation in the hut about confronting Vader was getting at. Luke had to prove that he could face Vader without giving into fear, which is the foundation of being a Jedi.