The accumulation of interpretation and rulings on various situations under the law means there's a thousand edge cases that have probably been brought up over the centuries and some ruling made. It all feels a bit like trying to rules lawyer god which is amusing to me as a TTRPG player but sounds exhausting if it were my real life.
[0] Though you also have to shut off the inlet water to the tank because the new water entering and being heated by the existing heated water (which you can use) counts as a violation. Source: https://www.star-k.org/articles/kashrus-kurrents/579/getting...
[1] https://www.star-k.org/articles/kashrus-kurrents/476/oven-ka...