It’s hard to imagine how it even happened.
Either they were not standing watch very good or they were dead in the water and the destroyer rammed them intentionally.
But, if they were DIW, ramming would not be necessary. A single shell from a five-incher would blow a PT boat to hell and gone.
I read a transcript of an interview of the Japanese Captain of the destroyer. It was made some time ago. He definitely rammed the PT boat on purpose. Their lookout spotted it but Kennedy’s did not spot the far larger destroyer.
The Kennedy PT boat was running with several others specifically for the purpose to spot Japanese ships. That is what looks so bad in that trying to see Japanese ships was what they were supposed to be doing yet let one ram them.