I think he is bored, and somewhere/someplace he came up with this , and now it's like ocd.
Ritualized, stylized, obsessive behavior like this often stims from being kept in too confined a space , with lack of mental stimulation. This type of ritualized ( different expressions of) used to be common in zoo animals back when they were kept in small bare cages forced close to the public so they could observe animals. Was still present when I was a child visting zoos. Thankfully us humans realized we needed to better. And zoos enlarged envious provide enrichments and cover. It's also something you see in domestic horses kept confined in a horse stall fir the majority of time. The horses will weave, crib , head toss or something else repetitive.
Because you have a nice roomy cage , and provide well for him , this is likely from before.
Quakers are really intelligent, on par with African grey and cockatoo, tho they rarely get credit for it. They are also extremely social, and evolved to live in large communities. So they are more prone to behavior issues, plucking, screaming, self mutilation or OCD .
Things that might help, even more toys , lots of different chew texture, things they can easily destroy with a chomp. Foraging, really fun do to do together too! Obstacles course to climb through to reach a reward. Teaching simple tricks , just for the mental stimulation. Increased time out of the cage . More exercise. Spending time outside, always watched in light shade well secured ( I zip tie every moving part of the cage including bottom tray. ) being outside really can have a profound effect on parrots their vision is incredible and outside they look into greater distance, and see more colors and feel sur movement.
When he is in the middle of obsessive behavior, they are in a mental zone , and it's not worthwhile to try and distract , or pay sny attention to it. What works better is to prevent these sessions from getting started , if you know times or triggers , plan positive distraction. A bath, floating plastic bottle caps with a single seed or something to try and get, foraging, or simple training or tricks , out of the cage something.
The more you can head this off, the less it should happen , sometimes will disappear forever as he weand off thst high, and gets those chemicals from exercise, destroying stuff and such. Sometimes the behavior remains but decreased in frequency and duration.