Maybe the config update didn’t take the first time and moving the Caddyfile and restarting Caddy from it actually put it on the right config? Only thing I can think of to explain that one.
For what it’s worth, you can give your Cloudflare API key to Proxmox itself to get its own HTTPS cert valid.
I do that myself and then have Caddy simply latch on to the Proxmox cert, purely to have the web UI on standard ports, I wrote about it here: