Yes,this is the correct procedure.
Immigration is mostly done on the ship but can be done in a port building if the authorities don't want to or can't be bothered to come aboard.
In this situation I would have to go and get my passport looked at and verified at the port building but I would want to get back on the ship and put my passport in the safe or give it to the pursers office.
I would then take a paper copy of my passport ashore if I could get past security/Immigration without too much hassle.
I had dinner with Handre on Saturday evening before he ran the London Marathon.
He flew out to Cape Town on Monday evening to attend a Seabourn event.
I bet he's devastated.