For me it just worked drawing a line directly to the boss-block. Zelda "targeted" the key hole and threw it in.
However, if that doesn't work, and it is a glitch, I would try whacking Zelda with the boomerang, making her drop the key, get her to pick it back up again, and try throwing it in again. If that doesn't work, I really have no idea.