Also, please share the sudo nginx -T output before and after Certbot did its thing. I'm not that familiair with Certbot and nginx, but with Apache, Certbot adds a new virtualhost. It would make sense for Certbot to generate a new server block for HTTPS entirely with nginx too, but I'm not sure about that.
It's quite clever. It reads the server blocks already present, finds the appropriate one for the domain gave and appends SSL certs to the end of the block.
Sometimes it rewrites some configuration, that's annoying, but yes, it works.
certbot is v1.27.0 on Alpine Linux v3.16.3, Nginx is 1.22.1 sudo certbot -d jancsi.cz and sudo certbot install -d jancsi.cz then