The consequences are that the outstanding invoice(s) continue to age and appear on aging reports and customer statements, as does the unapplied cash receipt (it doesn't age though).
You can match transactions with outstanding balances against each other by entering a zero dollar cash receipt in a cash batch, and applying the various negative and positive balances (hint - it's easier if you select the negative ones first) until the total unapplied balance for the cash receipt returns to zero. Then post. The date is not important, and neither is the check number.
This is not necessarily a mistake, often customers pay deposits and there is no invoice to apply the deposit against until later.
Steve