>> If you accidentally purchased a bag of M&Ms from Amazon for 500 dollars instead of 5, they will let you undo it
If it is technically possible, then it is the seller's mistake and the customer deserves a refund. The seller may choose to not undo. The customer may choose to sue them. It is a PR nightmare in today's world. It is illegal.
>> On the other hand, if the matter is reversed, Amazon is expected to be a good sport and take the loss — even if the purchase was made in bad faith (ie- knowing Amazon mis-priced it but purchasing it anyways.)
If it is technically possible, and if the customer has not hacked the system in any way, it is the seller's mistake. The customer should not care. Once the sale is made, it is legally over. The seller has no legal way of recovering the money from the customer. The seller should have verified the prices.