High refresh rate not work with nvidia optimus in linux

I have an MSI gs66 stealth (rtx 2060) with ubuntu 21.04 and although in settings I can select the refresh rate at 300hz (obviously supported at hw level) the screen clearly remains at 60hz, I did a lot of research online and I’m not the only one having this problem, from what I understand it concerns any laptop running nvidia optimus and it is a linux driver bug.
The only solution I have found is to disable optimus and use only the dGPU, but in this way the autonomy would suffer and a lot, please fix this bug.