But whenever I run caddy it ask me to agree on using let’s encrypt to generate the certificate. And whether I agree or not it fails to create the certificate.
The correct syntax for a self-signed certificate is tls self_signed, with an underscore instead of the dash used in the Caddyfile you posted.
The other information that can can be specified this way is an email, so I expect Caddy interprets self-signed as the email address you want to create an ACME account for (which would be invalid anyway).