Thank you, I really appreciate you taking the time to answer my question.
My bad on labeling neutral earth, I am still new to the AC side of electronics, as I said, and was using it as an analog of "GND" in DC. I will create global labels both for Live and Neutral in order to prevent any confusion. Regarding the connection of the metal casing to earth, I was planning on 3d printing my case so it will be plastic (probably PETG or PLA).
I didn't consider input filtering. In your opinion, can it be beneficial to include it in this kind of circuit?
I thought about using an external wifi relay, but given that I am planning on implementing a PWM control, I didn't want to be dependent on wireless communication. I thought about just powering the DC circuit with an external power supply, but since I already need mains, I didn't want to add another cable to run from the socket.
Regarding the concern on the circuit failing and the heater remaining on I am thinking of mitigating the issues this way:
1) The heater can be powered constantly without risk of melting. The PWM is only needed to reach the desired temperature setpoint.
2) I will probably use a normally open relay so that in case of power loss of failure of the control circuit, the heater will be disconnected.
3) On the software side I will monitor the temperature and send a notification if it exceeds some threshold
4) I will make the raspberry pico ping my server so that I will know if there's a power loss