That was my suggestion from the beginning,
In this case you need to connect everything to the breaker of your socket because the Shelly 2.5 does not have clean relais contacts!
Another solution could be to use only th N from your socket circuit, but only if the N from the socket is the same as for the fan circuit. Anyhow this would be a case for a professional electrician to check out the correct connections because I don't know how the rules for installation in your country are and if this is possible. Maybe you have two-pole breakers which disconnects L und N together Then it's not possible/not allowed to mix N from two circuits.