Thanks for your help, Gustavo, and for linking to that four-year-old thread. I felt certain that we had discussed this issue before, but I had no recollection that the thread-starter was none other than Coco herself.
I am perhaps fonder now than I was at the time of your suggestion that "the matter" can be analyzed as the equivalent of "wrong." Other possibilities include translating it as equivalent to "is bothering you," "is causing a commotion," etc.
This idiomatic usage always has the quality of a predicate, like "is wrong," "is bothering you," etc. There is always a presupposition that something is the matter / is wrong / is bothering you. The question inquires about the cause.
Perhaps the only declarative context in which the idiom "the matter" occurs is in such statements as "Nothing is the matter," which is often used (sometimes defensively) in answer to the question "What's the matter?"
The statement "Nothing is the matter" is worth pondering, Coco. It simply would not work (would make no sense whatsoever) to say, "The matter is nothing." Again, the idiom "the matter" is always a predicate; it is never the subject.
That is a pretty big generalization, and generally I like to avoid generalizations, but here I feel comfortable making one. If anyone came up with an example in which "the matter" (in this idiomatic usage) was truly a subject, I'd be impressed.