This saying is used, when a person doesn't have a solution for problems and doesn't know how to go on. To be at the limits of one's mental ressources.
Latin has been the language of education and science up to today. Its knowledge has become representative for knowledge and expertise. This idiom may be caused by the mockery of pupils who stopped and didn’t know how to continue in their Latin speech.