This whole process pisses off Shido, the tyrant king, since he's trying to use his son's marriage as a political bargaining tool. He wants to force Akechi to marry other royalty or a nobleman/woman, not...some guy. Just some random mystery dude who lives in an attic.
So, the last few challenges are created to kill Joker. They're not only difficult, but near impossible feats, like slaying beasts that have killed thousands of knights and heroes before him. So Shido can get Joker out of the way and use his own son as a political tool again.
But Joker keeps beating every challenge, still.
So the last one is made to just. Straight up kill him. Something completely impossible that can only result in Joker's death, and Shido forces Akechi to go along with it (even though he obviously doesn't want to).
"I've prepared your final trial, Thief," Akechi is forced to tell him. "Complete this last challenge, and you will have won the throne."
Akechi grimaced, knowing the fate that awaited the attic boy. "Yes. And my hand."
Joker smiled. "Then, what is it, darling?"
"You must break into the palace and steal 3 of my father's most precious treasures in the span of a night. Not a soul may notice you, and if you fail, Father will have your head."
The thief was unphased. "What am I stealing?"
Akechi closed his eyes. "First you will steal my father's scepter, which lies under glass in our treasury. You may not break the glass, and if it is moved, an alarm will ring."
"Then, you will steal my father's crown. You will have to break into his personal chambers, which have guards at every possible entrance, and steal the crown off his own head as he sleeps."
The prince swallowed. "Then, you will steal my father's heir."
At this, Joker blinked. "You mean-"
"Myself. You will break into my chambers as I sleep and steal me away without my notice. If I am awoken during this process, even if I merely stir, then you will have failed. And Father will have your head. Understand?"
"Damn it!" Akechi grit his teeth. "You fool!"
"And if I win," Joker repeated, "You'll marry me?"
"This is a death trap, you clown! There is no way for you TO win! You will only die, can't you understand that!?"
"Only if I lose." Joker was already smiling again, standing up and walking towards the nearest window. "So you don't have to worry."
"Just...J-Just give it up!" Akechi almost begged, "Leave the kingdom, don't come back! Stop trying to win this STUPID game, it's going to kill you!"
Joker leaned out the opened window, trying to find a good spot to use his grappling hook. He hadn't stopped smiling.
"You'll die, understand!? It's...I-I'm not worth it! Just-!"
The grappling hook made a loud *chink!* sound as it launched into a palace wall. "I'll see you tonight, darling~"
And with that, Joker blew his lover a kiss and flew away into the evening. The prince was left alone on the balcony, already mourning his loss.