All the immigration and passport items for most ports are done behind the scenes especially in the US, Canada, and the Caribbean thanks to the WHTI.
If there were to be a passport/immigration issue with a country you were traveling to, you would be denied boarding on the ship at the time of check-in at the embarkation port. The authorities would have flagged your reservation and you would not be able to sale. This is part of the reason that you have to enter your immigration info online ahead of time.
I have heard many stories of people getting to the port to check-in only to be turned away due to some immigration issue. On Canadian/Alaskan cruises, the person usually had a DUI offense in the past which Canada considers a serious offense.