I have exactly the same issue. My input delay in both keyboard and mouse disappears for a very short time (like 20-30 secs) in 5 occasions.
1. My mouse "idles" for 1+ minute (and the mouse ONLY, if I do this with keyboard - nothing happens). And then if I move my mouse again the input delay is literally perfect for... of course 20-30 secs at max.
2. If I change ANYTHING related to graphics in game settings. In ANY game. I tried that with Apex, Valorant, Csgo - it happens everywhere. So, I change one setting - the mouse and strafe feeling is perfect for 20 secs.
3. Alt-tabbing. If I alt-tab and open the game back - its almost (!) perfect for 20 secs. Actually it's not that perfect like in the previous examples, but it's still feels so much better.
4. Unplugging and plugging back in the monitor cable. Similar result to the 1st and 2nd.
OH, and the last one, the absolutely best example.
5. If I unplug and plug back in the ethernet cable. This is so far gives the best feeling of my input delay. It's actually comparable with the 4th, but it's slightly better. Actually the greatest improvement that I had was replacing my ethernet cable. When I did that 1st time I had literally the best mouse and strafe feeling in years. And it lasted for actually quite a long time - 5-8 minutes. And then it came back.
Idk how's all of that related, but I felt that I should write this.

