Curl out of memory when querying nix binary cache

After upgrading to Nix 2.9.1 I’m getting a lot of curl out of memory errors.

My local (system) nix is now 2.9.1, however if I run something with Nix 2.8.1 (project’s nix version) it yields a lot of errors:

error: unable to download '': Out of memory (27)
AWS error '' (curlCode: 27, Out of memory), will retry in 0 ms
AWS error '' (curlCode: 27, Out of memory), will retry in 50 ms
AWS error '' (curlCode: 27, Out of memory), will retry in 100 ms

Running the diagnostics script: (btw could not even run this with nix-shell since more failures like above occurred)

My nix config has this cache defined (along with a private one, but this is the one throwing errors):

substituters = 
trusted-public-keys = 

Have tried with VPN enabled and disabled with same outcome. Checking the diagnostics outcome there seems to be a lot of errors when attempting to reach which makes me wonder is this public cache still valid?

After I upgraded to nix 2.9.0, this error was happening all the time (upgrading to 2.9.1 resolved most of them). Is there a breaking change or incompatibility between 2.8 and 2.9 that are causing this issue?

minor update on this, I never found the cause but this seemed to happen when we provided a specific version of nix in the dev shell of our project which was different to the installed version of nix. Unsure whether this is even supported but certainly was causing this issue