I have not done it (doubt anyone has), but you have a high chance of having some problems with Canadian customs. They are likely to interpret your stop in JFK as being for the sole purpose of picking up a package and dropping it in YVR and will demand to see what it is. When you can't produce it they might search harder. By contrast US customs is much more sensible and won't target you. The arrival time of CX into YVR is not to your advantage (the agents are bored, have no other flight to work for hours, and resent being on that shift, also you are likely to be the only passenger deplaning at YVR). Presumably you are flying in F, and Canadian customs loves to single out F passengers (that I know from experience). So expect some hassle and come prepared.