A 40 minute connection on the way to the Caribbean is doable but you have no "wiggle room". Any type of delay with your inbound flight and you'll never make the connection. Murphy's Law of Air Travel will come in to play here. It clearly states that the shorter your connecting the greater your chances are that your inbound flight will be delayed, your arrival gate will be blocked and you'll sit on the tarmac waiting for the gate to clear, you arrival and departure gates will be the furthest possible distance apart and/or the gate agent will be late and have difficulty lining up the jetway delaying the deplaning of passengers.
If you are nervous now, imagine how you feel the day you fly. See if you can rebook to flights with a longer connection time.