Yes and no.
It depends a lot on the legislation of a country. For example, in Germany, if you are admitted involuntarily by social workers, the police or doctors, you must see a judge in the following 48 hours after your admission. Furthermore, you may not be treated or kept in mental care against your will if a judge has not ruled so. Meaning if you are admitted involuntarily, there must be pretty strong evidence suggesting that you actually need to be admitted.
However, it does look quite different if you admit yourself voluntarily: In the year 1973, Rosenhan conducted a experiment, investigating how voluntarily admitted pseudo patients are treated in closed mental care institutions. He wrote a paper about it, called "On being sane in Insane Places" Let me cite some passages from a summary of the study, published on dowellwebtools.com:
[Rosenhan] put together a team of eight perfectly healthy and sane "pseudo patients" [...] to have themselves committed in one of several psychiatric hospitals across the United States. In order to make this experiment work, the pseudo patients had to lie about [...] the fact that they heard a voice in their heads.
Immediately after admission, the pseudo patients acted normally [...] while discreetly taking notes for the experiment. They could not be released without staff corroboration of their sanity, which took from 7 to 52 days [...] to get.
When the pseudo patients were eventually discharged, none of them were seen as normal, but all with "schizophrenia in remission."
Searching for it on Wikipedia reveals that there is a second part to Rosenhan's study which is even more interesting:
The second part of his study involved an offended hospital administration challenging Rosenhan to send pseudopatients to its facility, whom its staff would then detect. Rosenhan agreed and in the following weeks out of 250 new patients the staff identified 41 as potential pseudopatients, with 2 of these receiving suspicion from at least one psychiatrist and one other staff member. In fact, Rosenhan had sent no pseudopatients to the hospital.
The core of your question can be answered with no: It's very unlikely for a person to be kept in mental care for a very long time without showing actual symptoms of a mental disorder. If you read Rosenhan's study carefully, you will find a passage that says that other patients got suspicious of the pseudo patients as they seemed "too normal".
During the first three hospitalizations, when accurate counts were kept, 35 of a total of 118 patients on the admissions ward voiced their suspicions, some vigorously. "You're not crazy. You're a journalist, or a professor [referring
to the continual note-taking]. You're checking up on the hospital."
So, sooner or later, someone would raise a concern.
Nevertheless, it is not unrealistic to be kept in mental healthcare for a shorter duration even though you show no symptoms or whatsoever. Rosenhan explains this as follows:
The hospital itself imposes a special environment in which the meanings of behavior can easily be misunderstood.
But before storming off now, saying that mental healthcare institutions can't diagnose properly, it's important to note that I couldn't find any replication of Rosenhan's study in our time, nearly 50 years later, and that his pseudo patients wanted to be admitted. The fact that they stopped showing symptoms right after they were admitted would probably leave anyone wondering what is going on, meaning that most would make closer and longer observations. (Why did he stop showing symptoms? Maybe a new disorder appeared?)
Conclusion: His findings don't necessarily have to hold true nowadays (at least to the extent he found), but it may be helpful to take them into account.