And you think, that would make a submarine surface ?
Firstly, using Active Sonar, gives the position of surface vessel and a firing solution faster than you can say the words "Torpedo , Torpedo, Torpedo", makes it sitting duck.
Secondly a submarine only surfaces, when
1) Either its ballast tanks are damaged.
2) Its hull is breached, and in order to survive, it will rather surface thank, sink.
3) It need carry out repairs or charge its batteries, while running on Diesel engines,
Or Most importantly
4) if it wants too, like Chinese submarine surfacing in middle of a NATO exercise, a few years back.
Or Swedish subs surfacing within torpedo firing range of American carrier.
All the above situations are intentional decision taken by the submarine commander.
P.S. : you should stick to aircrafts , naval discussions are not your niche.