I suspect Trump thought killing Khamenei would be a punctuation mark that would let him declare victory and disengage (like the June bombings of nuclear facilities). I also suspect it's going to have the opposite effect. It can't be overemphasized that Trump is dumb as a brick.