We have enough trump strength to cope with any distribution, and can set up a diamond trick. But we still need to ruff a losing heart with dummy's short trumps.
So, we win with ♥A, cash the ♥K, and lead a third round. We ruff as high as possible with dummy's ♠9, but East wins with the ♠10 and leads ♣K. We go one down. Were we just unlucky?
No! If we take a round of trumps at trick two and both defenders follow, we will then know that they could be drawn in (at most) three rounds, and we would still have a trump in dummy to ruff a heart. Unless trumps fall 4-0, we do not need to ruff a heart before completely drawing trumps.
Don't ruff a loser with short trumps before drawing them, if you can just as easily do it after trumps are drawn.