It is a little difficult to find this in the Laws! However, there is no doubt that the effect of the Laws on declarer is that cards intended to be played are played, those not intended are not. The effect of what you describe here is the same as if the heart was played and the spade was dropped, so I would rule the heart is played and the spade is returned to hand.
Is this covered by the Laws, Ed?