My ex spouse had restless leg syndrome. I discovered by eliminating caffeine from his diet, it also stopped the restless legs. If he cheated and consumed even one caffeine beverage after noon, the restless legs would recur. The maximum amount of caffeine he could consume was a single cup before noon. None after noon. Anything extra would result in restless legs.
So, you might try eliminating caffeine from your diet. It certainly worked in his case. There was a direct correlation which you could see every time he cheated on the caffeine. It is easy to try by eliminating your caffeine intake.
I am not a doctor. I’m an engineer & research scientist. I can only tell you what works for me or my family.
If you have a serious medical problem, you should always seek help from a medical professional.