hello: it is indeed a thermostat fault, hot water expands, increases its volume and tends to recede, surely the retention and relief valve was not in place, so the pressure was released by the cold water pipe,

to place the valve and it is advisable to change both thermostat and resistance new greetings