Not opening the torpedo doors is the most common cause of your error.
TMO doesn't change targeting behavior. It will change ship and torpedo behavior. If you're running TMO only, it may be ship behavior. TMO changes all AI to the highest level. The ships may have spotted your periscope and took evasive action. Just a minor turn or speed change will cause you to miss, especially from a long distance. I will fire a salvo of three or four aimed at different points along the length of the ship. I use auto-targeting and don't bother to lock on.