I have also encountered this exact issue after upgrading it to .net 8.0 from 6.0.
The error seems to come when trying to send a request from HttpClient, SendAsync/GetAsync/PostAsync and in my case, it is intermittent. It definitely worked on previous .net 6. and no change of code too.
Did you manage to resolve this? Or anybody has solution for this? Thanks.