Thank you for this feedback. After spending some time with Google I have been unable to locate any instances of a nuclear submarine surfacing due to sonar pressure or other forms of harassment outside of friendly exercises. While the lack of results is hardly definitive, it is suggestive in light of the incidents that did turn up in my search, including the detection and hounding to the surface of both Soviet and American diesel-electric boats such as several Soviet Foxtrot-class boats in 1962 and the USS Gudgeon in 1957 and the detection without hounding to the surface of SSNs such as USS Swordfish in 1963.
Generally speaking there are three possible - and non court-martial worthy - reasons for a SSN to surface/sail surfaced close to a foreign military asset in peacetime.
1. Show of force.
2. Innocent passage.
3. Emergency (technical or human).