Idiome
“C’est la fin des haricots.”
It’s the end of the beans – (‘It’s a catastrophe, a disaster’).
When supplies started to run low in 19th-century boarding schools, the kids had to eat the only thing left: beans. When there were no more beans, starvation loomed, hence the current meaning.