Back when the Navy had tactical nuclear weapons, there was a doctrine for shooting a target in an acoustic convergence zone. Not a great idea because the same conditions that allowed one to hear the target would focus the blast wave back to your ship.
As I recall (from the movie presentation) the charge was attached to the bow of the sub by a spar that was 15 to 20 feet long. I can’t imaging “harpooning” something that close with a charge that strong! And I believe that they were submerged when they struck the Housatonic.
My inclination would have been to tow the package behind me with enough buoyancy that, even when I went under the hull, the explosives would stay afloat and impact the ship (with the hull shielding me from the direct blast).
Would a sub take the blast better from bow or stern? I remember one of the subs in the area of the Kursk blast hardly noticed it because they were pointing directly at it. (Granted not a nuke)