Was the contract made and completed at point (a) or (b)? Or is the time of sale not legally defined so precisely?
In the scenario and particular ramifications you outline, identifying a precise instant where a contract ensues would be pointless and/or inconsequential. That does not mean that your question is pointless, though. The possible developments mainly have an effect on Ben's entitlement to void the contract.
Ben satisfies his obligation as soon as he pays an amount no lower than what Sam asks for the banana. From that point forward, Ben is entitled to walk away with (or eat) the banana. In the event that Ben overpaid, Sam's pending obligation to return change does not hinder Ben's entitlement to the banana.
Ben has two options if Sam fails or refuses to return change:
Void/rescind the contract (i.e., Ben changes his mind), thereby getting reimbursed. Obviously his consumption or deterioration of the banana would forfeit his ability to exercise this option.
Sue Sam for breach of contract, unjust enrichment, or --if Sam's deceitful intent is proved-- fraud.
Option 1 is available because, in terms of the Restatement (Second) of Contracts at § 151-153, Ben's "basic assumption on which the contract was made has a material effect on the agreed exchange of performances". Here, Ben's basic assumption is premised on the price tag "50 pence". Ben, as "the adversely affected party" in the actual (versus agreed) exchange of performances, may void the contract.
Eating the banana despite knowing that Sam was out of change puts Ben in the position of Bear[ing] the Risk of a Mistake. See Restatement at § 154. That forfeits Ben's right to void the contract, but not his entitlement to receive change.
Common practice also reinforces Ben's entitlement to change his mind. This is contemplated in Restatement at § 222 ("Usage of Trade"). Indeed, it is common and quite acceptable for a customer to desist from the purchase if the seller has no change. That is understood to inconvenience the customer because of the resulting delay. If Sam sought to force the purchase, his burden will be to prove that this instance is special and entails questions of fact in which he would prevail.