Why so many 504 errors and my worker still functional?

I am using Cloudflare worker to do redirect, any request to my domain A, I do some modification and redirect it to another site(domain B) using “Response.redirect()”. and it works fine, the analytics on domain B shows everything works fine. at least it has 10k DAU.

but today I found there might be some issue on my site, domain B got less traffic. then I login Cloudflare, in the dashboard of worker, I saw so many 504 errors, not sure what happened, and there is so less 200 status code. you can see in some days there zero 200 status code.
so I got confused by the dashboard, where does these 504 error come from?
I opened the realtime log stream for awhile and see all the request returns ok.