I had the exact same problem. Nice solution on target one, fire, unlock periscope tracking, lock on second target, adjust TDC data, fire, torpedoes go way off track, WTF!!!! LOL.
I've found that the PK will keep the original (i.e. first) target data regardless of what you do with the TDC for your next target (speed, range, AoB, periscope lock). The red 'button' on the PK needs to be switched "off" and "on" again to 'clear' it of the 'old' data. So once you unlock from your first target, also switch off the PK. Lock your next target then switch on the PK again (you'll know it's working when you see the sub and ship hull outlines in the PK 'swing' to their new data headings etc).
Hope this helps.