Kd4 is not a legal move. You are never allowed to put yourself into a check.
Even though it's possible to argue "black's knight can't take my king as that would put his king in check", it's still not legal. You can imagine that if the game could continue, black would capture the white king before white could capture the black king, and black would therefore win. This is of course just a device for explaining the why, as capturing a king is just as much an illegal move as putting your own king in check.