Problem with APT proxy

Some machines get this error while commissioning:

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package lldpd

When going into rescue mode and manually doing apt update:

sudo apt update
Err:1 focal InRelease
  Connection failed [IP: 8000]
Hit:2 focal-updates InRelease
Hit:3 focal-security InRelease
Hit:4 focal-backports InRelease

It seems to be a random problem with the APT proxy in MAAS.
If I switch to an external proxy (standard HTTP proxy), it just works.
How can this be debugged?

we had similar issue preventing commission of new nodes.
The error was related to the squid proxy on the maas node. Yet the error was a bit different:

Err:4 focal InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)

Cleaning up the proxy cache on the maas node did solve the issue.

sudo mv /var/spool/maas-proxy /var/spool/maas-proxy.old
sudo mkdir -p /var/spool/maas-proxy
sudo chown -R proxy:proxy /var/spool/maas-proxy
sudo chmod -R 0750  /var/spool/maas-proxy

There is maybe a better solution to clean up the squid cache.

There is still some ongoing discussion with the MAAS support team how to detect these and maybe autoclean the squid proxy after a while.

@bjornrun, did the suggested solution above help?