Since i am on channel 44 for 5Ghz my pings are low.
But, i just noticed some interesting things:
When i switch to my 2,4ghz Wifi, behaviour is like in your picture with the red squares.
I think channel 6 might not be right channel for 2,4ghz (i live in germany)
The interesting part: Exact same behaviour on my 10 year old retina Macook Pro (running Big Sur)!!
Ping even times out occasionally (only 2,4ghz). I think this has always been this way, but i have never noticed it doing normal browsing etc.
Another interesting thing i noticed is, that if i click on the wifi symbol while i'm running the ping, i'm kinda simulating the channel switching leading to higher pings. I assume this is because opening the wifi menu tells the OS to scan for WiFis on all channels, leaving the current channel for a short amount of time.