Nextcloud cert broken after updates

No, that error means just what it says: the certificate authority that issued the cert the site is using isn’t trusted by your browser. That would be expected for an installation from my script (it defaults to obtaining a cert from the Let’s Encrypt testing servers, to avoid hitting their rate limits), if you hadn’t subsequently run the remove-staging.sh script. That a working installation would revert to using that server, though, wouldn’t be expected.

Well, let’s check. I’m not aware of anyone else using Caddy in any kind of automated installation of Nextcloud, so it should be easy to find out. Go into the jail (iocage console nextcloud), and run service caddy status. If Caddy is running, you installed this using my script. In that case, it’d be best to continue on the topic for that script:

When you post there, include the complete contents of your Caddyfile (/usr/local/www/Caddyfile), though mask API tokens and other credentials.