In almost 20 cruises, I have seen many a folk make a mad dash to the port, only to miss the ship sail off. It's almost funny, but not really. Medical emergencies are handled differently, They know WHO isn't onboard and will leave you in a heartbeat. The ship pays port fees and there are fines for delays.
There is an obvious algorithm as to what the ship's captain will allow per circumstance. For example, my mom fell on port and broke her hip in New Brunswick, her travel companion, needed to get back to the ship to get their passports, they gave him a 15 minute leeway for the ship departure. Luckily he made it.
Too many variables to say, but the staff told the companion, that there are plans in place for various scenarios, running to the ship without calling them, isn't one of them. Port security number is helpful to have on your phone, should you have concerns with this. They have a direct line to the ships captain.