Test Y against the two building blocks of an attempt. First, did he mean to commit the offence? Second, did he do something towards it that crossed the line from preparation into execution? If both boxes tick, the attempt is made out, and the question of whether he actually got the jewels never arises. Success is what turns an attempt into the completed offence, so failure is a normal feature of an attempt charge, not a defence to it.
So option (B) is the answer. The rule worth carrying away is that the criminality of an attempt is measured by the accused's intention and conduct, not by the luck of what he found waiting for him.
Let's summarize:
Y meant to steal and broke the box open in doing so, which makes him guilty of attempt to commit theft under option (B).