The canal pilots work for the company that operates the canal, not for the shipping company. So if the canal pilots screwed up the navigation, they’re acting as an extension of the company that operates the canal, making the company liable for running the ship aground.