Did anyone ever make a mistake in ship identification?
Definitely, although most of those were mistakes in confusing one Japanese ship for another. Captains might identify a cruiser as a battleship or a destroyer as a cruiser. They might overestimate the size of the cargo ship or tanker that they attacked.
In other cases, our submarines were attacked by friendly aircraft or ships, particularly early in the war. As a result, submarines quickly learned to never trust any airplanes except, perhaps, those planes that would escort the boat into port. It isn’t completely clear, but we may have lost one or two submarines to our own aircraft.
In one of the saddest incidents in the war, an American submarine sank a Russian hospital ship. It was misidentified in the fog as an enemy combatant, and the captain had not seen the notice that the hospital ship would be transiting the area. It was a diplomatic disaster. The captain lost his command.