While it is true that cash is legal tender, this can still be overridden by mutual agreement (i.e. in a contract). So the legal tender status only matters if payment methods were not agreed upon before entering into an agreement.
In other words: If a restaurant lets you eat without telling you they do not accept cash, they will have to accept cash. However, if they explicitly tell you they only accept card payments, they can insist on this later.
This applies in both the United States, in Germany, and in Canada (see e.g. It may be legal tender, but more businesses are snubbing cash).
So to address your points:
As I understand the legality would work something like this:
1) I accept the the contract where I agree to pay with card in exchange for food
Yes - however, in accepting the contract you also accept that the restaurant is "cashless" (assuming the restaurant clearly tells you so, e.g. by putting up a sign or by saying it in person).
I attempt to fulfill the contract to the best of my ability, but am prevented from doing so by circumstances beyond my control
Yes. Since you attempted to fulfill the contract, you did not commit the crime of theft (which requires intention not to pay). However, you still owe what you promised when entering into the agreement, which is to pay with a card.
At this point I owe the restaurant the money, but since the original transaction failed, this is a debt, which I offer to settle with legal tender
No. As explained above, if the agreement stipulates a specific payment method, this generally overrides the "legal tender" aspect.
In short:
- You agreed to pay with a card, so you are required to pay with a card.
- If you cannot pay with a card, you have not fulfilled your part of the agreement. It is is arguable that it is not your fault, but this does not change your obligation.
Now you must either negotiate a suitable alternative (cash, cheque, golden watch...), or come back to pay later with a card. Also, the business may be able to charge you additional costs, such as extra accounting work or interest because of your non-standard payment - that would depend on the details.