Sea travel was expensive and very hazardous, like the plains and mountain crossings. Besides shipwrecks, there was a significant chance of contracting a fatal disease while crossing the isthmus. There were no insecticides or bug sprays and mosquitos carried fatal diseases. Then the sea voyage up the west coast was fraught with peril, too. There were lots of shipwrecks on the west coast in the mid 1800s and very few lighthouses and fog horns to warn ships off the rocky shoals.
Interestingly, the first lighthouse on the west coast was not on the coast itself, but in San Francisco Bay. Alcatraz Island Lighthouse was the first one built on the U.S. West Coast in 1854, located on Alcatraz Island in California’s San Francisco Bay. It served the bay during its time as a Citadel and military prison. It was replaced by a taller (95 feet) concrete tower lighthouse in 1909 to the south of the original one which was demolished after it was damaged in the 1906 earthquake.
Seventy lighthouses were built on the west coast in the mid 1800s to the early 1900s.
You’re right, not for the faint hearted. They should have gone by Southwest Airlines, but not via a 737 Max 8. For what’s it worth it, those who could afford it, took the sea route until the railroad was finished.