220V relay + ESP32 + aquarium heater
Is this an old metal-cased aquarium heater? It's possible that the insulation is breaking down between the heater element and its metal case leading to your RCD/GFCI tripping. This is a characteristic failure mode for mineral insulated heaters.
You can carry out a quick check with an ordinary multimeter.  With the heater completely disconnected from the mains supply measure the resistance between either heater connection and the metal case. If it's less than 0.5 MΩ you need a new heater. If it's more than 0.5 MΩ it's not in the clear yet as these heaters need to be tested at twice their operating voltage (500V for you) with a proper insulation tester to be safe.
As you are building projects mixing mains voltage with water it would be worth you getting a cheap insulation tester of your own (like this). Failing that you might find an electrician or electrical installers who would be prepared to check your heater with an insulation tester.