The duke has gone full Villain now...I guess when Eunuch Tsao died in Episode 30 with 5 more episodes to go, there has to be a new villain and plot twist. However, the Emperor isn't necessarily better than the Duke. Starting from the First Ming Emperor, the emperor always killed his best talents (hence biggest potential threats) when it was convenient to themselves, not necessarily if it benefited the empire (like Yuanchunhuan in the last last Ming emperor's court, their only general who could fight the Manchus).