In this case, your conclusion is flawed; here is why:
Premises:
1 Entity A is a bookseller
2 Entity B is a bookseller
3 Entity A would charge no more than $X for the book
4 Entity B would charge $X for the book
5 The method by which entity B gets the book in these examples is considered wrong.
(X can be 0)
Your example, physical book:
State 0:
* You have $X that you intend to spend to purchase the book
* Entity A has the book
* Entity B exists
State 1:
* You have $X that you intend to spend to purchase the book
* Entity B has the book
* Entity A no longer has the book
State 2:
* You have the book
* Entity B has $X
* Entity A does not have the book
What actually happened:
State 0:
* You have $X that you intend to spend to purchase the book
* Entity A has the book
* Entity B exists
State 1:
* You have $X that you intend to spend to purchase the book
* Entity A has the book
* Entity B has the book
State 2:
* You have the book
* Entity A has the book
* Entity B has the book and $X
In either case, I believe that the correct response is to move the $X from B to A, not to move the $X back from B to you and remove the book from you.
Entity A is upset because it didn't get the money/recognition from selling the book to you; moving the $X from B to A and letting you know addresses those things.
Obviously, if any of the premises are wrong, the conclusion changes.
If 1 is false, then the correct response in your case is to do exactly what Amazon did, and reverse the transaction. This may be true in the second case too, although I personally disagree.
If 2 is false, then the situation doesn't happen because entity B doesn't sell you the book.
If 3 is false, then the correct response is to give you the choice of paying the difference or reversing the transaction.
If 4 is false, then the situation is a bit more complicated, and is not related to what actually happened, so I'm not going to talk about it.
If 5 is false, then the correct response is to do nothing.
I'm confident that this is true for any thing, not just books, but I'm not certain.