This happens when there is poor planning by the cargo ship's officer. Algeciras port
On 11 June the German-owned Antigua and Barbuda-flagged container feeder ship Deneb (1994/3,992gt, 508TEU) capsized in the port of Algeciras while loading containers alongside the Juan Carlos I Quay at the port’s AP Maersk Terminal.
Despite the extensive damage to the 101m long vessel, which normally sails between Algeciras and West African ports, there were no casualties, with three seafarers on board at the time suffering only minor injuries, caused when they jumped overboard as the ship listed heavily towards the dockside. The incident occurred 12 hours after stability problems had stopped loading. Despite attempts by two tugs to hold the vessel’s position at the seaward port side, Deneb continued to heel, and two days later she had completely rolled over, being about 50 per cent submerged. Salvage Company Svitzer were hired to right her and began operations by removing containers from the vessel.