I was going to comment, but decided to answer instead.
It’s plausible a few German U-boats DID taunt allied ships during WW 2, but it was also a dangerous gamble which could cost the entire U-boat their lives with little reward... As illustrated in Greyhound, where all the U-boats died.
There are, however, several factors working against the scenario, firstly being that most U-boats simply didn’t have radios capable of transceiving Allied comms.
Additionally, whether above water or below, radio waves do not propagate past the surface of water.
Therefore German U-boats would have to surface in order to taunt allied ships — a foolishly dangerous game — and then DF (not, it should be noted, HFDF) would quickly resolve a LOB (line of bearing).
HFDF wouldn’t work because U-boats were not usually outfitted with HF, transmitting instead in VHF range. When they were outfitted with HF, a massive antenna between 15 to 75 meters would be dragged behind the sub on the surface, giving a strong visual target indicator.
I thoroughly enjoyed the movie, but my biggest complaint was it didn’t accurately represent naval customs and courtesies.
There is no saluting indoors, and especially on a cramped ship, where a sharply rendered salute can frequently mean an elbow in someone’s jaw.
Attention on deck should have been called when the Captain of Greyhound entered the bridge, and sailors not on the helm should have stood at attention, but offered no salutes.
I’m not a sailor, and never been on a naval vessel underway, so I’m open to correction.