Unfortunately I am in Scotland, it's December and it's wet and cold. I have an interest in Scottish History and I think I have an idea how your ancestors may have ended up in Panama and Jamaica. In 1698 Scotland attempted to set up a colony in Panama. Your ancestors were possibly among the settlers who didn't make it back to Scotland. The following info is all from History textbooks,
July 1698: Fleet of four Scottish ships leaves Leith carrying 1,200 settlers and cargoes to trade.
November 2, 1698: First landing in Caledonia Bay,Panama.
December 4, 1698: Treaty of Friendship signed with Indians.
February 5, 1699: Scottish ship, Dolphin, captured by Spanish.
June 22, 1699: Colony abandoned because of disease, hunger and a proclamation from the English governor of Jamaica prohibiting colonists from helping the Scots in any way. Only one of the five original ships makes it back to Scotland and fewer than 750 settlers survive.
August 18, 1699: Unaware the colony has been abandoned, second expedition sails with 1,300 settlers from the Clyde to Darien.
November 30, 1699: Second expedition arrives on St. Andrew's Day to find the colony deserted. They send 500 men and all the women to Jamaica-starting a long Scottish association with the island.
February 15, 1700: Scots defeat Spaniards at Toubacanti. Rioting breaks out in Edinburgh when news of victory reaches Scotland.
March 31, 1700: Scots in Fort St Andrew surrender after sustained Spanish attack. Colony abandoned. Ships are wrecked or captured on return journey.