This crazy plan might have worked. The torpedoes were strong enough to seriously damage the lock gates, and it is immensely difficult to do any repairs on the lock gates. In addition, the defenders at Panama completely slacked off after the victories in 1943 and 1944. The real reason they plan was canceled was the IJN didn't think it would affect the war, since the I-400 class weren't built until mid-1944.
Even if the plan went off perfectly, it would only disable the Panama canal for six months. It wouldn't do anything about the massive Essex-class doom-fleets already in the Pacific by 1945. The IJN would still be completely out-matched for those six months, and then the canal would be fixed.
I-401's roomPraise me more, admiralThe war is long since over...Panama CanalNow's not the time to be dreaming!Operation Successful!Aichi M6A SeiranDestructionJapan lost the war so the plan did not come to pass...I-401
No battle recordHeading out!I-401Stopping the Atlantic fleet from entering through the Panama Canal gateLongest traveling distance (can go around the earth in a week and a half)