Roger Delafroozi was putting the finishing touches to his dinner - a traditional Persian herb stew - and had just one ingredient left to add.
But when he went to pop in a can of red kidney beans, he was stunned to discover it contained chickpeas instead.
"It was just my luck," the Ocean Beach resident said.
Originally from Iran, he was trying to prepare a Persian dish of ghormeh sabzi, which requires special dried herbs sent to him by family.
It's a meal he hadn't eaten in about two-and-a-half years.
"The red kidney beans take so long to cook so I decided to get a can [which is faster].
"Adding the red kidney beans is the last thing to do. I had cooked pretty much everything else."
But when he turned to pour in the contents of the opened can, he realised it contained chickpeas, not red kidney beans as stated on the label.
"I was struck and confused for a couple of seconds."
He couldn't use them in the stew and "not being a fan of chickpeas" threw away the offending legumes.
While the stew wasn't quite like he's used to, it still tasted all right, he said.
Delafroozi was able to find the humour in the unfortunate mix-up, likening it to winning Lotto.
"It's a small mistake.
"But when you buy a can of something you expect what's inside to be what it says on the outside."
He wasn't worried about a refund as it was "only a few dollars" though he acknowledged it could be "dangerous" if other items had been swapped.
The experience had put him off buying canned beans in future.
"It will take extra time to cook but I'd rather wait the two hours than get another surprise."
Delmaine Fine Foods, the company under whose label the goods were sold, has been approached for comment and is making inquiries into the incident.