What you have is a split DNS arrangement.
On the internet, Cloudflare acts as your external DNS resolver and resolves your domain name to your external IP address. Through port forwarding, your Caddy reverse proxy directs external clients to the correct local server.
On the private network, your local DNS resolver has to resolve the domain name to the IP address of the Caddy reverse proxy. The Caddy reverse proxy then directs local clients to the correct local server.
For more details, refer to the Wiki article Using Caddy as a reverse proxy in a home network