buyer allowed to back out of contract?

Page 82 of REG textbook: Seller agrees on February 15th to sell wheat at $6 to buyer on June 23rd. On June 1st, buyer backs out. Seller sells the wheat for $5 instead to a third party. The textbook claims that the buyer wrongfully revoked acceptance of goods, and is thus liable for a lawsuit. I could see why that would be the case if this was custom-designed machinery, but this is a commodity. Aren't both buyers and sellers allowed to back out of a contract anytime before payments are made and goods are delivered?