Docker snap fails when building using docker compose

I recently stumbled across the following error

[+] Building 17.1s (1/1) FINISHED                                                                                                                                                                          
 => ERROR [internal] booting buildkit                                                                                                                                                                17.1s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                                                    2.4s
 => => creating container buildx_buildkit_default                                                                                                                                                    14.7s
------                                                                                                                                                                                                     
 > [internal] booting buildkit:
#0 17.14 time="2023-10-31T12:33:22Z" level=warning msg="using host network as the defaultime="2023-10-31T12:33:22Z" level=warning msg="using host network as the default"
#0 17.14 time="2023-10-31T12:33:22Z" level=warning msg="skipping containerd worker, as \"/run/containerd/containerd.sock\" does not exist"
#0 17.14 dtime="2023-10-31T12:33:22Z" level=info msg="found 1 workers, default=\"jbv801nt0swxi6eh6h1y6qgnh\""
#0 17.14 `time="2023-10-31T12:33:22Z" level=warning msg="currently, only the default worker can be used."
#0 17.14 time="2023-10-31T12:33:22Z" level=warning msg="skipping containerd worker, as \"/run/containerd/containerd.sock\" does not exist"
#0 17.14 time="2023-10-31T12:33:22Z" level=warning msg="currently, only the default worker can be used."
#0 17.14 time="2023-10-31T12:33:22Z" level=warning msg="currently, only the default worker can be used."
#0 17.14 
------
http: invalid Host header

when executing

sudo docker compose up --build -d

There is something wrong with BuildKit in the latest stable version (20.10.24) of Docker snap.

It can be easily fixed by installing the latest edge version (24.0.5)

sudo snap refresh docker --channel=latest/edge

However, I wonder if it could be considered to keep not only the latest/stable version of this snap available. Actually, Docker is business critical for many and the ability to choose a specific version could be very helpful.