A seventeen-year-old finds a baggy full of oregano, and takes it, thinking it's weed. Should he be charged with possession of marijuana?
I think that case would be justified. I mean, I don't think the action itself is (I would rather drugs be legalized). But the legal logic is sound. If you're willing to do a certain action, then you've violated the law. Ostensibly, there is no difference between the real thing and the fake thing if you didn't know it was a setup. The problem here would be proving that the person was not aware it was fake.
If you attempted to assassinate a VIP, but instead killed their double, you would still be charged with an assassination attempt (e.g. treason) alongside the murder charges. It isn't a legal defense to say "well, I didn't
actually assassinate a VIP, therefore the treason charge is not justifiable." All that matters is that you tried to do something of which you were unaware it was fake.