When discovered, a few people have heart attacks, then calm down and move forward with a fix. ;)
The title company you are referring to would be a title agent and not the actual title insurance company, what we would call the title underwriter. The title underwriter would step in and take responsibility for fixing the problem since the agent was authorized to perform these acts on their behalf. Title underwriters are large insurance companies and not of the nature to take off, so the system has stability.
The mortgage lender, presumably, has a loan policy and so their position is insured. The borrower has signed a promissory note and related documents which would evidence the intention to create a secured interest for the lender. If the original mortgage document is missing, a new document would be presented to the borrower for signature and then it would be properly recorded.