I had the same issue for years, and I just found the fix for my case:
In Nvidia control panel, you have to set the color depth to 8 bpc, instead of 10 or 12. I used to change it to the highest value, and that seems to trigger the problem
Windows 10 - Shadow on Windows desktop not smooth/rough-screenshot-2021-01-26-195707.png