With regard to when "miss the boat" originated, Christine Ammer, The Facts on File Dictionary of Clichés, second edition (2006) has this for the phrase:
miss the boat/bus, to To fail to take advantage of an opportunity; to arrive too late for profit. The analogy to missing a scheduled transport is fairly obvious and has been around since about 1900. One of its more curious uses was in a speech by Prime Minister Neville Chamberlain commenting (April 4, 1940) on Adolf Hitler's invasion of Norway: "Hitler has missed the bus." This was odd in view of Chamberlain's own temporizing and attempts at pacification, which gave Hitler more time to embark unimpeded on his conquest of Europe.
J.E. Lighter, Random House Historical Dictionary of American Slang (1994), has this:
miss the boat 1. to miss one's opportunity.
[First citation:] 1929 [Frank C.] Bowen Sea Slang 90: Miss the Boat: To be late for anything.
Bowen's book, Sea Slang, a Dictionary of the Old-timers' Expressions and Epithets was published in London and presumably refers to British English sea slang.
The saying "miss the boat" obviously began as a literal expression of arriving too late to travel as scheduled on a boat. For example, from Florence Marryat, Captain's Norton's Diary, serialized in Belgravia (May 1870):
'You have deserted the company of your friend Dunn very quickly,' I remarked to him. 'The Ostrich does not leave for another hour. I thought you were going to breakfast on board.'
'I thought of doing so,' he answered carelessly (he had been talking of nothing else on our way there) ; 'but perhaps it's better not—might miss the boat, you see, which would be awkward. Will you introduce me to Miss Anstruther?'
In Google Books search results, metaphorical use of "miss the bus" seems to be earlier than similar use of "miss the boat." The earliest instance is from George Reid, My Reminiscences (1917):
In 1878 I left the [Colonial] Treasury [of Australia] and became the Secretary of the Crown Law Offices—a step into the legal world. I was admitted to the Bar in September, 1879. Thus came to an end the prolonged struggle between my ambitions and my enjoyments. I very nearly “missed the 'bus.” One text often flashed across my remorseful consciousness: “Unstable as water, thou shalt not excel!" If I have excelled in anything, I fancy it has been owing far more to the weakness of my adversaries, and the generosity of my friends and supporters, than to any merit of my own.
It also appears metaphorically in D.H. Lawrence, Lady Chatterley's Lover (1928):
Clifford, of course, had still many childish taboos and fetishes. He wanted to be thought "really good." Which was all cock-a-whoopy nonsense. What was really good was what actually caught on. It was no good being really good, and getting left with it. It seemed as if most of the "really good" men just missed the bus. After all, you only lived one life: and if you missed the bus, you just were left on the pavement, along with the rest of the failures.
Connie was contemplating a winter in London, with Clifford, next winter. He and she had caught the bus all right, so they might as well ride on top for a bit, and show it.
The earliest Google Books match for "miss the boat" used metaphorically is from The Journal of Electrical Workers and Operators (March 1935):
"The A. F. of L. Missed the Boat"
This title is taken from an editorial from "Business Week," once liberal business magazine. It is similar in tone to those in Raymond Moley's "Today," other business magazines, and the conservative newspapers, and is characterized by glee at the so-called defeat of the American Federation of Labor in the automobile industry. Apart from antic glee the editorial is characterized by the assertion that Washington, the government and industry are disappointed at the failure of the American Federation of Labor to measure up. Unions have missed a great opportunity under the enabling features of NIRA through lack of vision, laziness or sheer waywardness. So the unions, having missed the boat, are deserving of no further consideration and the United States should pass on to something else. No flimsier fiction for publicity purposes was ever invented. ...
... There has been appearance of fairness but not actual fairness and the kept press has refused to enlighten any one as to the real conditions, so when the "Business Week" speaks of the A. F. of L. missing the boat, it is putting the boat before the wharf. The boat missed the A. F. of L. It never arrived. In its place a nice new liner of the Fascistic type has been drawn up alongside the dock and is waiting for he American workman to embark upon an autocratic regime.
Another early instance is in a recurring magazine advertisement that the Curtiss Wright Technical Institute ran for at least three years for its training courses for aeronautical engineers and airplane mechanics. From Flying Magazine (April 1940):
WARNING!—"don't miss the boat." The greatest opportunity of your lifetime exist today! There never was such an opportunity in aviation for you; there may never be another. A position awaits you. Insure for yourself a steady income and independence for life. DON'T FOLLOW—LEAD! Send in your enrollment today before you "miss the boat."
On this rather skimpy record, it appears that "miss the bus" was the earlier metaphorical phrasing in everyday usage, and that it originated in British (or Australian) English no later than 1917. The wording "miss the boat" was reportedly used by British sailors before 1929, and it appears in U.S. English by 1935. The "miss the bus" alternative doesn't seem to have caught on in U.S. English as it did in British English.
An allied expression, "That ship has sailed," begins to appear in Google Books search results as a metaphorical expression much later, with two instances from 1979, in the context of regulation—in Perspectives on Retail Strategic Decision Making and The Deregulation of the Banking and Securities Industries.