I think the error you’re seeing is the same I talk about in the solution to https://caddy.community/t/combining-the-layer4-and-http-apps-ssl-pass-through-http-file-server-reverse-proxy
You need to send a non HTTP2 request to your server for it to work properly. But as that solution says, it’s not ideal.
As far as I can tell, the solution in that thread solves your problem exactly but it doesn’t use listener wrappers.
I keep a caddyfile which contains my http server configurations and then use the adapt
command to produce my json that I copy and paste my layer4
config into the top of. So I usually don’t need to write json (or yaml in my case) ever.