Translation:What is the trouble?
"Komaru" is one of those Japanese verbs that references something in the past to tell you about the present. Something happened, and now you are in the state of being troubled. When you ask "nani ga komarimashita ka?" you are seeing that the person is currently troubled, and are asking what happened to cause that state.
Another example of this kind of verb behavior would be saying "kaze o hikimashita", which literally means "I caught a cold", but is explaining that now, currently, you have a cold.
"I caught a cold" is actually a good example, as you have the same construct in English there. "Caught" is past tense, but is often used in a context where you imply that you currently have a cold. E.g. "How're you doing? - Not great, I caught a cold."
Or, for that matter, consider the even more ubiquitous "I have got" to mean you possess something, where "got" is past tense.
I don't think this Japanese sentence is appropriate when someone wants to ask someone who seems to be in trouble...
I would ask,「何（なに）かありましたか？」、「何（なに）かお困（こま）りですか？」、「どうかしましたか？」or「どうしたんですか？」
「何（なに）がこまりましたか？」this is asking about a sort of specific things,
Some Japanese constructions use past tense to express a present meaning, in the sense of, you became troubled at some point in the past, and you are (we're assuming) still troubled as a result of that. IsolaCiao gave the example of "I caught a cold", which is the same principle applied to English.
I've explained in another comment in this thread, but the translation is not wrong, the verb in the past tense reflects that something happened that has resulted in you currently being in a state of trouble. A Japanese person says こまりました (komarimashita) when they are in a current state of trouble.