The bang is probably a worn out three way valve . When they sometimes make a bang when springing back to hot water mode when heating shuts down . That is most likely when it does it , and the flow of water through it makes the ball shut the heating port very suddenly causing a bang , if you have...