Your "legal" answer is flat wrong.
Your moral compass works well though.
Its the old contract law question of unilateral mistake versus bilateral or multilateral mistake, or the "Case of the Pregnant Cow", a famous Canadian ( I think Ontario) case back in the last century which is always taught in law schools as explaining these issues. Walker vs. Somebody, or Somebody vs Walker..
In the cow case, Seller had a cow which, though of wonderful breeding and lineage, was thought to be barren and unable to calve.
Seller wanted to sell cow. Buyer, a neighbor, appeared and wanted to buy cow for beef (Canadian beef --- uuugh! Didn't they know about mad cow disease?))
Buyer and seller both believed that cow was barren. Buyer sold and seller bought for a cheap price as a meat animal, not as breeding stock.
Amazingly, cow was pregnant when sold, and Buyer discovered same before slaughtering. Buyer used cow in breeding herd.
Seller sued for return of cow on basis of mutual mistake.
Seller won, and got cow back, IIRC, because both parties were mistaken about essential element of the contract, i.e. was cow capable of calving. . Taxing my memory here a bit because its been 35 years since the textbook cases in contracts class, but the issue is were both parties mistaken as to the nature of the item(s) contracted to be sold, or was only one party mistaken.
If both parties were mistaken, then there is no "meeting of the minds", no contract, and the seller gets all his stuff back and the buyer gets his money back.
If only one party was mistaken, tough, as it was that party's fault to not have learned as much as the other party.
Why does it not surprise me that in English, Canadian and US contract law, having more knowledge than the other party and putting something over on the other party will be rewarded, yet if both parties are too ignorant to know what they are doing, the courts will grant relief. Reward trickery, punish universal ignorance.
If you think the unilateral mistake / bilateral mistake and the "Pregnant Cow" case are just for amusement, I want to sell you a car, used or new.