A recent question got answers indicating, among other things, "If you spend 100gp on a pearl but the seller ripped you off and the pearl you got is only worth 50gp, then it doesn't count as a 100gp pearl for spell components." That's all reasonable to me: magic probably doesn't care about the economy, it just has some need for a "good enough" pearl and such a pearl happens to cost 100gp in a fair trade.
However, lets say a Wizard isn't very good at this whole "haggling" thing and buys the first pearl he finds which happens to have a "100gp" tag on it, then trys to cast identify with it. Naturally, he got ripped off and the pearl is too small or too bad, or maybe not even a pearl at all.
Based on answers to the other question, the spell shouldn't succeed, but did he just waste a spell slot on the attempt?
In my mind, the same rule should apply to other components as well; normally a caster would know if they can't move well enough for somatic components or can't speak for verbal components, but if they were wrong (due to an illusion maybe?) and tried when the components weren't available, it seems that should be the same.
Basically, if a character thinks they can cast a spell, and tries to do so, but was wrong and could not supply some of the components, is the spell lost or does it get stopped early enough in the process to just do nothing?