Where is this found in the suttas? The suttas often describe how a King executes a murderer, thief or adulterer for their crimes. These suttas say the murderer, thief or adulterer commits bad karma but they do not comment on the King.
Suppose, Susima, that a robber, an evil-doer, having been caught, were shown to a king: 'This, your majesty, is a robber, an evil-doer. Decree what punishment you want for him.' And so the king would say, 'Go and — having bound him with a stout rope with his arms pinned tightly against his back, having shaved him bald — march him to a harsh-sounding drum from street to street, crossroads to crossroads; evict him out the south gate of the city and there, to the south of the city, cut off his head.' Then the king's men, having bound the man with a stout rope with his arms pinned tightly against his back, would march him to a harsh-sounding drum from street to street, crossroads to crossroads, evict him out the south gate of the city and there, to the south of the city, cut off his head. What do you think, Susima? Wouldn't that man, for that reason, experience pain & distress?"
https://www.accesstoinsight.org/tipitak ... .than.html