Can’t erase SSD

Hello, I few days ago my Mac stop loading the OS, today I start recovery mode with option + command + r and I go to Disk Utility and erase but the process stay for hours in Creating the partition map. I try to use a usb with Catalina and install but I get an Internal error. I already try to install Ubuntu but I get an error when try to format.

EDIT: My Mac is encrypted so for access to recovery mode I have to put the password before access

Is there a way to repair?

Thanks