If the knave of hearts did steal the tarts, then the knave of clubs is lying saying that the knave of hearts is lying which mean the knave of diamonds is actually telling the truth when the knave of clubs said the knave of diamonds is lying they are therefore lying.
So in the question may be knave of hearts and Knave of diamonds may be telling the truth OR knave of clubs and knave of spades are telling the truth.