I found the problem. It was not related with the degraded state of the array (obviously I replace the faulty disk). It was related to the version of zfs as in this issue:
LXD 5.12: ZFS stopped working in lxd - Error: Required tool ‘zpool’ is missing when kernel ZFS module version < 0.8
I upgraded the OS from ubuntu 20.04 to 22.04 and everything works fine.