Your script looks fine and it also seems to do what you want as per the picture shown below. If the issue is the angle looking wrong then I don’t think that’s necessarily your script not working but rather a case of not having the correct rotational values you want. Feel free to experiment with different values to see if you can get a key rotation you like.
Personally I wouldn’t try to do any CFraming of the sort and would just use attachments to designate where I want the key to snap when I weld it to the player’s hand. Sometimes I might do this with accessories but in cases where they don’t work or baked-in behaviours butcher my use case I just use a model and weld it directly to the player’s hand. If the latter idea interests you, check here.
Please do be aware that what I’ve written there is not a full code sample, so you should not just copy and paste my code expecting it to work out of the box. You need to do setup yourself to make sure it works with your systems or you can use it as a learning sample to see how I accomplish this.